Return to Snippet

Revision: 17875
at September 15, 2009 18:34 by marcocs


Initial Code
function timeDebugger() { };

timeDebugger.prototype.d = new Date();
timeDebugger.prototype.t = new Date();

timeDebugger.prototype.start = function() {
    this.d = new Date();
    this.t = this.d.getTime();
};

timeDebugger.prototype.end = function() {
    this.d = new Date();
    return (this.d.getTime() - this.t);
};

Initial URL


Initial Description
Javascript time execution utility:
Use: 

var otd = new timeDebugger();
otd.start();
alert(otd.end());

Initial Title
Time Execution Javascript

Initial Tags
debug

Initial Language
JavaScript