Last active
December 14, 2018 15:36
-
-
Save elhardoum/ee82494a1e0c0d0fdf0c3cc098eceffd to your computer and use it in GitHub Desktop.
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
var start = +new Date, d, chrono | |
setInterval(function() | |
{ | |
d = new Date( +new Date - start ) | |
chrono = (''+d).match( /\d+:\d+(?= )/g )[0] + ':' + Math.floor(d.getMilliseconds()/100) | |
document.body.innerHTML = chrono.replace(/(\d+)/g, '<span>$1</span>').replace(':', '\'').replace(':', '"') | |
}, 100) |
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
var start = +new Date, d | |
setInterval(e => { | |
d = new Date( +new Date - start ) | |
document.body.innerHTML = '' | |
+ '<span>' + d.getMinutes() + '</span>\'' // minutes | |
+ '<span>' + ( d.getSeconds() < 10 ? '0' : '' ) + d.getSeconds() + '</span>"' // seconds | |
+ '<span>' + Math.floor(d.getMilliseconds()/100) + '</span>' // milliseconds | |
}, 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment