Created
September 10, 2018 18:31
-
-
Save davidicus/12c736ae90f470933b202dab0b06fc3c to your computer and use it in GitHub Desktop.
Millisecond math for common time spans used in timers like setTimeout and setInterval
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Math for common time spans used in timers like setTimeout and setInterval | |
// Once a minute | |
// there are 1000 milliseconds in a second and 60 seconds in a minute | |
1000 * 60 | |
// Once an hour | |
// Same as above and there are 60 minutes in an hour | |
1000 * 60 * 60 | |
// Once a day | |
// Same as above and there are 24 hours in a day | |
1000 * 60 * 60 * 24 | |
// Once a week | |
// Same as above and there are 7 days in a week | |
1000 * 60 * 60 * 24 * 7 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment