Simple JavaScript Time library with stop-watch and backward-clock...
Need a JavaScript stop-watch functionality? Or backward time counter?
Want to execute a function after specified time? This small javascript library could help you...
jsTimeWatch is a free /open source/ JavaScript Time Library that currently includes stop-watch and backward counter functionality (with few additional support functions only). It is just something I made the other day for my own use, and naturally -- decided to release it as free and open source library (but not public domain!)... See the demo below -- it should give you a good idea what that library does.
jsTimeWatch Demo: |
||
stopWatch:
0
start | split | stop |
backWatch:
0
start | stop |
alertAfter():
alert after 5 seconds |
Here is a code snippet to give you an idea how the stopwatch javascript is invoked:
/* create stopWatch object */
var stopWatch = new jtl.stopWatch(); ... /* executed on "start" link clicked: */
function start(){
if(stopWatch.start()!=null){
stopWatch.executeOnRefresh(refresh); //function to execute on refresh
var value= stopWatch.splittime();
$('#timer').find('.value').text(toTime(value));
$('#split_times').html('');
}
}
Visit the "help" section for documentation and guides.
AND PLEASE NOTE -- THIS IS JUST THE FIRST RELEASE. If you found a bug, have a question or comments -- just let me know.
Requirements:
Dependencies: