Indicates the time elapsed (in milliseconds) since the call to
ChronoStart. The stopwatch is not stopped.
New in version 28
DurationMyFunction1 is int
DurationMyFunction2 is int
TotalDuration is int
// Start the stopwatch
ChronoStart()
MyFunction1()
DurationMyFunction1 = ChronoEnd()
Info("The MyFunction1() process lasted " + DurationMyFunction1 + " milliseconds")
ChronoStart()
MyFunction2()
DurationMyFunction2 = ChronoEnd()
Info("The MyFunction2() process lasted " + DurationMyFunction2 + " milliseconds")
TotalDuration = DurationMyFunction1 + DurationMyFunction2
Info("The total process lasted " + TotalDuration + " milliseconds")
Syntax
Indicating the value of a timing started with a stopwatch number Hide the details
<Result> = ChronoValue([<Stopwatch number>])
<Result>: Duration
Time elapsed (in milliseconds) since the last call to ChronoStart for the specified stopwatch number.
<Stopwatch number>: Optional integer
Identifier of stopwatch used. If this parameter is not specified, its default value is set to 1.
Remarks
After calling
ChronoEnd, all the calls to
ChronoValue will return the value of the stopwatch when
ChronoEnd was called.
Error
A WLanguage error occurs ("The stopwatch is not started") if
ChronoStart was not called before
ChronoValue.
Threads and parallel tasks
Each thread (and each parallel task) includes its own stopwatches.
Two distinct threads (or two distinct parallel tasks) can perform separate timings by using the same stopwatch number.
The WLanguage error "The stopwatch is not started" will occur only if
ChronoStart and
ChronoValue are not called in the same thread.
Business / UI classification: Neutral code