Stops a stopwatch and returns the time elapsed (in milliseconds) since the start of timing (call to
ChronoStart). This stopwatch can be restarted by
ChronoResume if necessary.
New in version 28
// Start the stopwatch
ChronoStart()
MyFunction()
// Stop the stopwatch
DurationMyFunction is Duration = ChronoEnd()
Info("The MyFunction() process lasted " + DurationMyFunction)
// Start the first stopwatch
ChronoStart(1)
// Start the second stopwatch
ChronoStart(2)
// Stop the first stopwatch
DurationChronoStart is Duration = ChronoEnd(1)
MyFunction()
// Stop the second stopwatch
DurationMyFunction is Duration = ChronoEnd(2)
Info("MyFunction() process lasted" + DurationMyFunction, ...
"The whole process lasted " + DurationChronoStart)
Syntax
Ending the timing started with a stopwatch number Hide the details
<Result> = ChronoEnd([<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
Miscellaneous
If
ChronoEnd is called twice on the same stopwatch without
ChronoStart being called, the returned duration will be identical for the two calls (the stopwatch is stopped during the first call to
ChronoEnd).
Error
A WLanguage error occurs ("The stopwatch is not started") if
ChronoStart was not called before
ChronoEnd.
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
ChronoEnd are not called in the same thread.
Business / UI classification: Neutral code