summaryrefslogtreecommitdiff
path: root/devel-utf8/itjs/timer.js
diff options
context:
space:
mode:
authorNathan Gass2012-03-22 18:23:53 +0000
committerNathan Gass2012-03-22 18:23:53 +0000
commit338cda9000356404cf2865d61787607acf67fe98 (patch)
tree3924b3e2e12a5d5ea3b40890477d5e070498543c /devel-utf8/itjs/timer.js
parente0a89b408041d25b18090bfc3d596627ea930507 (diff)
downloaditools-338cda9000356404cf2865d61787607acf67fe98.tar.gz
itools-338cda9000356404cf2865d61787607acf67fe98.tar.bz2
itools-338cda9000356404cf2865d61787607acf67fe98.zip
last remains of wrong branch itools/live/devel-utf8 removed
Diffstat (limited to 'devel-utf8/itjs/timer.js')
-rw-r--r--devel-utf8/itjs/timer.js64
1 files changed, 0 insertions, 64 deletions
diff --git a/devel-utf8/itjs/timer.js b/devel-utf8/itjs/timer.js
deleted file mode 100644
index ee04cbb..0000000
--- a/devel-utf8/itjs/timer.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Start new timer
- * Example: timer = new it_timer({ object:this, method:"timer", timeout:100});
- *
- * @param p.object Object to call method in when timer fires
- * @param p.method String with method name to call in object
- * @param p.timeout Timeout in milliseconds
- * @param p.continuous One-shot or continuous timer, default is one-shot
- * @return timer id (deprecated, use method stop() instead)
- */
-function it_timer(p)
-{
- this.func = p.continuous ? "Interval" : "Timeout";
- return this.timer = window["set" + this.func](function() { p.object[p.method](p) }, p.timeout);
-}
-
-it_timer.prototype =
-{
-
-stop: function()
-{
- if (this.timer)
- {
- window["clear" + this.func](this.timer);
- this.timer = null;
- }
-} /* NO COMMA */
-
-}
-
-/**
- * Global helper function to benchmark javascript
- * @parameter label Message label like "start" or "end"
- * @paramter print Whether to output timerlog via ED() and clear it (optional)
- */
-function it_timerlog(label, print)
-{
- if (window.it_timerlog_active)
- {
- var end = new Date().getTime();
-
- if (typeof window.it_timernow != "undefined")
- {
- var start = window.it_timernow;
-
- if (window.it_timerlogmsg != "")
- window.it_timerlogmsg += ", ";
-
- window.it_timerlogmsg += label + ":" + (end - start);
- }
- else
- window.it_timerlogmsg = "";
-
- window.it_timernow = end;
-
- if (print)
- {
- ED("timerlog: " + window.it_timerlogmsg);
- window.it_timerlogmsg = "";
- }
- }
-}
-
-it_timerlog(""); // Set start time