gsusmi / stopwatch.js Goto Github PK
View Code? Open in Web Editor NEWThis project forked from takhoffman/stopwatch.js
Stopwatch javascript library
This project forked from takhoffman/stopwatch.js
Stopwatch javascript library
**Documentation: At the moment the stopwatch only supports doing intervals of one second. It's also mandatory to create a new TimeSpan() object to pass to the stopwatch, going to change this later on. The output formats for the stopwatch are as follows: stopwatch.toString(0); // output: 1.02:03:00 day.hour:min:sec stopwatch.toString(1); // output: 01 day 02 hours 03 mins 00 secs stopwatch.toString(2); // output: 1 day 2 hours 3 mins 0 secs doesn't pad zeros stopwatch.toString(3); // output: 26 hours 3 mins 0 secs - note - does not display days only hours stopwatch.toString(4); // output: 26:03:00 hour:min:sec - note - does not display days only hours Some of the other methods are: stopwatch.toMilliseconds(); //This returns the elapsed time in milliseconds stopwatch.toHoursRounded(); //This returns the total amount of hours rounded to two decimal places e.x. 5.15 **Example code: //Initialize the time var initialTime = new TimeSpan(0); //Initials out to 00:00:00 //Create new stopwatch object and pass it the initial time var stopwatch = new StopWatch(initialTime) //Start the timer stopwatch.start(); //Get the value of the stopwatch stopwatch.toString(4); // Returns HH:MM:SS //Stop the timer stopwatch.stop(); //Reset the timer stopwatch.reset(); **TODO: Create stopwatch without passing it initial TimeSpan() Allow more options for intervals (such as milliseconds)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.