PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Various
  • Error
  • Threads and parallel tasks
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Indicates the time passed (in milliseconds) since the call to ChronoStart. The stopwatch is not stopped.
To stop the stopwatch, use ChronoEnd.
Versions 24 and later
iPhone/iPadApple WatchWindows MobileUniversal Windows 10 App Note: This function is equivalent to ..Valeur of Chrono variables.
New in version 24
iPhone/iPadApple WatchWindows MobileUniversal Windows 10 App Note: This function is equivalent to ..Valeur of Chrono variables.
iPhone/iPadApple WatchWindows MobileUniversal Windows 10 App Note: This function is equivalent to ..Valeur of Chrono variables.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
DurationMyFunction1 is int
DurationMyFunction2 is int
TotalDuration is int
// Start the stopwatch
ChronoStart()
MyFunction1()
DurationMyFunction1 = ChronoEnd()
Info("The MyFunction1() process lasted " + DurationMyFunction1 + " milliseconds")
 
ChronoStart()
MyFunction2()
DurationMyFunction2 = ChronoEnd()
Info("The MyFunction2() process lasted " + DurationMyFunction2 + " milliseconds")
 
TotalDuration = DurationMyFunction1 + DurationMyFunction2
Info("The total process lasted " + TotalDuration + " milliseconds")
 
DurationMyFunction1 is int
TotalDuration is int
// Start the stopwatch
ChronoStart()
MyFunction1()
DurationMyFunction1 = ChronoValue()
Trace("The MyFunction1() process lasted " + DurationMyFunction1 + " milliseconds")
 
MyFunction2()
TotalDuration = ChronoEnd()
Trace("The total process lasted (including the display) " + TotalDuration + " milliseconds")
 
Versions 24 and later
iPhone/iPadApple WatchWindows MobileUniversal Windows 10 App
DurationMyFunction1 is int
TotalDuration is int
MyChrono is Chrono
// Start the stopwatch
ChronoStart(MyChrono)
MyFunction1()
DurationMyFunction1 = ChronoValue(MyChrono)
Trace("The MyFunction1() process lasted " + DurationMyFunction1 + " milliseconds")
 
MyFunction2()
TotalDuration = ChronoEnd(MyChrono)
Trace("The total process lasted (including the display) " + TotalDuration + " milliseconds")
 
New in version 24
iPhone/iPadApple WatchWindows MobileUniversal Windows 10 App
DurationMyFunction1 is int
TotalDuration is int
MyChrono is Chrono
// Start the stopwatch
ChronoStart(MyChrono)
MyFunction1()
DurationMyFunction1 = ChronoValue(MyChrono)
Trace("The MyFunction1() process lasted " + DurationMyFunction1 + " milliseconds")
 
MyFunction2()
TotalDuration = ChronoEnd(MyChrono)
Trace("The total process lasted (including the display) " + TotalDuration + " milliseconds")
 
iPhone/iPadApple WatchWindows MobileUniversal Windows 10 App
DurationMyFunction1 is int
TotalDuration is int
MyChrono is Chrono
// Start the stopwatch
ChronoStart(MyChrono)
MyFunction1()
DurationMyFunction1 = ChronoValue(MyChrono)
Trace("The MyFunction1() process lasted " + DurationMyFunction1 + " milliseconds")
 
MyFunction2()
TotalDuration = ChronoEnd(MyChrono)
Trace("The total process lasted (including the display) " + TotalDuration + " milliseconds")
 
Syntax

Indicating the value of a timing kept with a stopwatch number Hide the details

<Result> = ChronoValue([<Stopwatch number>])
<Result>: Duration
Time passed (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.
Versions 24 and later
iPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Indicating the value of a timing kept with a Chrono variable Hide the details

<Result> = ChronoValue(<Stopwatch>)
<Result>: Duration
Time passed (in milliseconds) since the last call to ChronoStart for the specified stopwatch.
<Stopwatch>: Chrono variable
Name of the Chrono variable type corresponding to the stopwatch to use.
New in version 24
iPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Indicating the value of a timing kept with a Chrono variable Hide the details

<Result> = ChronoValue(<Stopwatch>)
<Result>: Duration
Time passed (in milliseconds) since the last call to ChronoStart for the specified stopwatch.
<Stopwatch>: Chrono variable
Name of the Chrono variable type corresponding to the stopwatch to use.
iPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Indicating the value of a timing kept with a Chrono variable Hide the details

<Result> = ChronoValue(<Stopwatch>)
<Result>: Duration
Time passed (in milliseconds) since the last call to ChronoStart for the specified stopwatch.
<Stopwatch>: Chrono variable
Name of the Chrono variable type corresponding to the stopwatch to use.
Remarks

Various

For a same stopwatch, after the call to ChronoEnd, all the calls to ChronoValue will return the value of the stopwatch during the call to ChronoEnd.

Error

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 and ChronoValue are not called in the same thread.
Related Examples:
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
Business / GUI classification : Neutral code
Component : wd250vm.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment