ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Date and time functions
  • 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
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:
Example
// Démarrage du chronomètre 
ChronoStart()
MaFonction()
// Arrêt du chronomètre 
DuréeMaFonction is Duration = ChronoEnd()
Info("Le traitement MaFonction() a duré " + DuréeMaFonction)
// Démarrage du premier chronomètre 
ChronoStart(1)
// Démarrage du second chronomètre 
ChronoStart(2)
// Arrêt premier chronomètre
DuréeChronoDébut is Duration = ChronoEnd(1)
MaFonction()
// Arrêt du second chronomètre
DuréeMaFonction is Duration = ChronoEnd(2)
Info("Le traitement MaFontion() a duré " + DuréeMaFonction, ...
	"Le traitement complet a duré " + DuréeChronoDébut)
Reports and QueriesWindows
MonChrono1 is Chrono
MonChrono2 is Chrono
// Démarrage du premier chronomètre 
ChronoStart(MonChrono1)
// Démarrage du second chronomètre 
ChronoStart(MonChrono2)
// Arrêt premier chronomètre
DuréeChronoDébut is Duration = ChronoEnd(MonChrono1)
MaFonction()
// Arrêt du second chronomètre
DuréeMaFonction is Duration = ChronoEnd(MonChrono2)
Info("Le traitement MaFonction() a duré " + DuréeMaFonction, ...
	"Le traitement complet a duré " + DuréeChronoDébut)
Syntax

Timing with a stopwatch number Hide the details

ChronoStart([<Stopwatch number>])
<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.
Remarks

Error

A WLanguage error occurs ("The stopwatch is not started") if ChronoStart was not called before ChronoValue and 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 is not called in the same thread (or in the same parallel task) as ChronoValue and ChronoEnd.
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).
Business / UI classification: Neutral code
Component: wd300vm.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help