Skip to content
Snippets Groups Projects
Commit a46b0692 authored by mcmlxxix's avatar mcmlxxix
Browse files

added logStamp(msg) function. useful in debugging speed issues.

timestamps the supplied message in logs, relative to last function call
parent 2aff6932
No related branches found
No related tags found
No related merge requests found
......@@ -436,6 +436,23 @@ function sortListByProperty(list,prop)
}
return data;
}
function logStamp(msg)
{
if(!js.global.LogTimer)
js.global.LogTimer={};
var t = js.global.LogTimer;
var now = Date.now();
if(!t.start || (now-t.start > 10000)) {
t.start = now;
t.last = now;
}
if(!t.last)
t.last = now;
log(format("%4d",(now-t.last)) + " [" + (now - t.start) + "] " + msg);
t.last = now;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment