Starts a stopwatch to measure the duration of a process (in milliseconds) and resets a running stopwatch. The timing is stopped:
If timing is stopped, it can be restarted with ChronoResume
The value of the stopwatch can be read at any time:
New in version 28 Chrono
variables are now available for Java applications. The syntax for handling Chrono
variables also becomes available.
// Start the stopwatch
// Stop the stopwatch
DurationMyFunction is Duration = ChronoEnd()
Info("The MyFunction() process lasted " + DurationMyFunction)
// Start the first stopwatch
// Start the second stopwatch
// Stop the first stopwatch
DurationChronoStart is Duration = ChronoEnd(1)
// Stop the second stopwatch
DurationMyFunction is Duration = ChronoEnd(2)
Info("MyFunction() process lasted" + DurationMyFunction, ...
"The whole process lasted " + DurationChronoStart)
Timing with a stopwatch number Hide the details
<Stopwatch number>: Optional integer
Identifier of stopwatch used.
If this parameter is not specified, its default value is set to 1.
If this number corresponds to a running stopwatch, it is reset to zero.
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
is not called in the same thread (or in the same parallel task) as ChronoValue
Business / UI classification: Neutral code