|
|
|
|
- Miscellaneous
- Error
- Threads and parallel tasks
<Chrono>.End (Function) In french: <Chrono>.Fin Stops a stopwatch and returns the time elapsed (in milliseconds) since the start of timing (call to <Chrono>.Start). This stopwatch can be restarted by <Chrono>.Resume if necessary.
New in version 28MyChrono1 is Chrono MyChrono2 is Chrono // Start the first stopwatch MyChrono1.Start() // Start the second stopwatch MyChrono2.Start() // Stop the first stopwatch DurationChronoStart is Duration = MyChrono1.End() MyFunction() // Stop the second stopwatch DurationChronoStart is Duration = MyChrono2.End() Info("The MyFunction() process lasted " + DurationMyFunction, ... "The whole process lasted " + DurationChronoStart)
Syntax
Stopping the timing started with a Chrono variable Hide the details
<Result> = <Stopwatch>.End()
<Result>: Duration Time elapsed (in milliseconds) since the last call to <Chrono>.Start for the specified stopwatch. <Stopwatch>: Chrono variable Name of the Chrono variable that corresponds to the stopwatch to use. Remarks Miscellaneous If <Chrono>.End is called twice on the same stopwatch without <Chrono>.Start being called, the returned duration will be identical for the two calls (the stopwatch is stopped during the first call to <Chrono>.End). Error A WLanguage error occurs ("The stopwatch is not started") if <Chrono>.Start was not called before <Chrono>.End. 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 <Chrono>.Start and <Chrono>.End are not called in the same thread.
Related Examples:
|
Unit examples (WINDEV): The Chrono functions
[ + ] Using the ChronoXXX functions. These functions are used to calculate the time passed between the start (ChronoStart) and the end (ChronoEnd).
|
|
Unit examples (WINDEV): Calculations on durations
[ + ] Calculations on dates and times with the WLanguage functions: - Calculate the duration between two moments (dates and times) - Calculate a sum of durations - Calculate an average of durations
|
|
Unit examples (WINDEV Mobile): The Chrono functions
[ + ] Using the WLanguage "Chrono" functions. These functions are used to calculate the time passed between the start (ChronoStart) and the end (ChronoEnd).
|
|
Universal Apps (WINDEV Mobile): UWA Stopwatch
[ + ] This example explains how to create a stopwatch for a mobile device with WINDEV Mobile. In this example, a timer is used to display the hands of the stopwatch and to display the time passed on a regular basis.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|