ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Date and time functions
  • Miscellaneous
  • Error
  • Threads and parallel tasks
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
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.
Example
MonChrono1 is Chrono
MonChrono2 is Chrono
// Démarrage du premier chronomètre 
MonChrono1.Start()
// Démarrage du second chronomètre 
MonChrono2.Start()
// Arrêt premier chronomètre
DuréeChronoDébut is Duration = MonChrono1.End()
MaFonction()
// Arrêt du second chronomètre
DuréeMaFonction is Duration = MonChrono2.End()
Info("Le traitement MaFonction() a duré " + DuréeMaFonction, ...
	"Le traitement complet a duré " + DuréeChronoDébut)
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:
The Chrono functions 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).
Calculations on durations 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
The Chrono functions 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).
Component: wd300vm.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/21/2024

Send a report | Local help