@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux phosweb009 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
Current Path :
/
homepage
/
v-mt
/
mt-static
/
js
/
tc
/
Path :
Upload File :
New :
File
Dir
//homepage/v-mt/mt-static/js/tc/benchmark.js
/* # Movable Type (r) (C) 2003-2008 Six Apart, Ltd. All Rights Reserved. # This code cannot be redistributed without permission from www.sixapart.com. # For more information, consult your Movable Type license. # # $Id: benchmark.js 1174 2008-01-08 21:02:50Z bchoate $ */ /* -------------------------------------------------------------------------------- TC.Benchmark benchmarking utility class -------------------------------------------------------------------------------- */ /* constructor */ TC.Benchmark = function() { this.ticks = [] this.start(); } /* instance methods */ TC.Benchmark.prototype.start = function() { this.ticks = []; this.tick( "start" ); } TC.Benchmark.prototype.tick = function( name ) { var date = new Date(); var time = date.getTime(); var last = this.ticks.length ? this.ticks[ this.ticks.length - 1 ].time : time; var delta = time - last; var start = this.ticks.length ? this.ticks[ 0 ].time : time; var total = time - start; var tick = { "name" : name, "time" : time, "delta" : delta, "total" : total }; this.ticks[ this.ticks.length ] = tick; return tick.total; } TC.Benchmark.prototype.report = function( name ) { var out = ""; for( i = 0; i < this.ticks.length; i++ ) { var tick = this.ticks[ i ]; out += tick.name + ": " + tick.delta + " " + tick.total + "<br />\n"; } return out; }