googleid_111159
13 years agoNew Contributor
StopWatch object
Hi,
Can you please explain me why StopWatch object behaves this way?
here is code:
function test()
{
var timer1 = HISUtils.StopWatch;
var timer2 = HISUtils.StopWatch;
timer1.Start();
aqUtils.Delay(10000);
Log.Checkpoint("---10 sec elapsed----");
Log.Checkpoint("t1 split: " + timer1.Split());//~10000
Log.Checkpoint("t2 split: " + timer2.Split());//0
timer2.Start();
aqUtils.Delay(10000);
Log.Checkpoint("---20 sec elapsed----");
Log.Checkpoint("t1 split: " + timer1.Split());//~20000
Log.Checkpoint("t2 split: " + timer2.Split());//~10000
timer1.Stop();
aqUtils.Delay(10000);
Log.Checkpoint("---30 sec elapsed----");
Log.Checkpoint("t1 split: " + timer1.Split());//~50000 ---- ??? supposed to be 20000
Log.Checkpoint("t2 split: " + timer2.Split());//~20000
timer2.Stop();
aqUtils.Delay(10000);
Log.Checkpoint("---40 sec elapsed----");
Log.Checkpoint("t1 string: " + timer1.ToString());//50sec ---- ?
Log.Checkpoint("t2 string: " + timer2.ToString());//20 sec
Log.Checkpoint("t2 split: " + timer2.Split());//~50000 --- ???
Log.Checkpoint("t2 string: " + timer2.ToString());//50 sec --- ?
}
log is attached
Can you please explain me why StopWatch object behaves this way?
here is code:
function test()
{
var timer1 = HISUtils.StopWatch;
var timer2 = HISUtils.StopWatch;
timer1.Start();
aqUtils.Delay(10000);
Log.Checkpoint("---10 sec elapsed----");
Log.Checkpoint("t1 split: " + timer1.Split());//~10000
Log.Checkpoint("t2 split: " + timer2.Split());//0
timer2.Start();
aqUtils.Delay(10000);
Log.Checkpoint("---20 sec elapsed----");
Log.Checkpoint("t1 split: " + timer1.Split());//~20000
Log.Checkpoint("t2 split: " + timer2.Split());//~10000
timer1.Stop();
aqUtils.Delay(10000);
Log.Checkpoint("---30 sec elapsed----");
Log.Checkpoint("t1 split: " + timer1.Split());//~50000 ---- ??? supposed to be 20000
Log.Checkpoint("t2 split: " + timer2.Split());//~20000
timer2.Stop();
aqUtils.Delay(10000);
Log.Checkpoint("---40 sec elapsed----");
Log.Checkpoint("t1 string: " + timer1.ToString());//50sec ---- ?
Log.Checkpoint("t2 string: " + timer2.ToString());//20 sec
Log.Checkpoint("t2 split: " + timer2.Split());//~50000 --- ???
Log.Checkpoint("t2 string: " + timer2.ToString());//50 sec --- ?
}
log is attached