Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple timer with javascript
var timer = {
started: 0,
end: 0,
now: function(){ return new Date(); },
start: function(){ return this.started =; },
since: function(){ this.end =; return; }
// Usage:
console.log("Timer started at "+timer.start());
// Something
console.log("Some process: " + timer.since() + "ms");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.