2012-09-19 22:25:13 +02:00
|
|
|
/* WARNING:
|
|
|
|
|
|
|
|
This file is only included when Django's DEBUG = True and your
|
|
|
|
host is in INTERNAL_IPS.
|
|
|
|
|
2012-10-30 02:29:32 +01:00
|
|
|
Do not commit any code elsewhere which uses these functions.
|
2012-09-19 22:25:13 +02:00
|
|
|
They are for debugging use only.
|
|
|
|
|
|
|
|
The file may still be accessible under other circumstances, so do
|
|
|
|
not put sensitive information here. */
|
|
|
|
|
2012-10-04 18:36:59 +02:00
|
|
|
// It's fine to use console.log etc. in this file.
|
|
|
|
/*jslint devel: true */
|
|
|
|
|
2012-09-19 22:25:13 +02:00
|
|
|
/*
|
|
|
|
print_elapsed_time("foo", foo)
|
|
|
|
|
|
|
|
evaluates to foo() and prints the elapsed time
|
|
|
|
to the console along with the name "foo". */
|
|
|
|
|
|
|
|
function print_elapsed_time(name, fun) {
|
|
|
|
var t0 = new Date().getTime();
|
|
|
|
var out = fun();
|
|
|
|
var t1 = new Date().getTime();
|
|
|
|
console.log(name + ': ' + (t1 - t0) + ' ms');
|
|
|
|
return out;
|
|
|
|
}
|