ObjectGears Help

           
Forum   ObjectGears (Version: 1.6.0.0)

Stopwatch

This object is used for an accurate measuring of script speed.

If you need to perform an optimization of data processing by means of scripts, this object may be used for an accurate measurement of various processing methods and find a place with the biggest time burden and an optimal option of processing.

 

Name Description
TimeSpan Elapsed Time from the timer start.
long ElapsedMilliseconds Time from the timer start in miliseconds.
bool IsRunning Indication, whether the timer is running.
void Reset() Method sets the timer to null.
void Restart() Method resets the timer.
void Start() Method starts the timer.
void Stop() Method stops the timer.

Příklad

var sw = OG.Utils.CreateStopwatch();
sw.Start();

... tested script

sw.Stop();

//write to log
OG.Log.Write('Elapsed: ' + sw.Elapsed);
OG.Log.Write('Elapsed in miliseconds: ' + sw.ElapsedMilliseconds);

This website is using cookies files to provide services and analyse visits. You agree with that by using this website.     Further information