PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Miscellaneous
  • 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
Stops a stopwatch and returns the time passed (in milliseconds) since the start of timing (call to ChronoStart). This stopwatch can be restarted by ChronoResume if necessary.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
Universal Windows 10 App This function is now available for Windows Phone applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
Universal Windows 10 App This function is now available for Windows Phone applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Universal Windows 10 App This function is now available for 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
// Start the stopwatch
ChronoStart()
MyFunction()
// Stop the stopwatch
DurationMyFunction is Duration = ChronoEnd()
Info("The MyFunction() process lasted " + DurationMyFunction)
// Start the first stopwatch
ChronoStart(1)
// Start the second stopwatch
ChronoStart(2)
// Stop the first stopwatch
DurationChronoStart is Duration = ChronoEnd(1)
MyFunction()
// Stop the second stopwatch
DurationMyFunction is Duration = ChronoEnd(2)
Info("MyFunction() process lasted" + DurationMyFunction, ...
"The whole process lasted " + DurationChronoStart)
Versions 24 and later
Reports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 AppUser code (UMC)
MyChrono1 is Chrono
MyChrono2 is Chrono
// Start the first stopwatch
ChronoStart(MyChrono1)
// Start the second stopwatch
ChronoStart(MyChrono2)
// Stop the first stopwatch
DurationChronoStart is Duration = ChronoEnd(MyChrono1)
MyFunction()
// Stop the second stopwatch
DurationMyFunction is Duration = ChronoEnd(MyChrono2)
Info("The MyFunction() process lasted " + DurationMyFunction, ...
"The whole process lasted " + DurationChronoStart)
New in version 24
Reports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 AppUser code (UMC)
MyChrono1 is Chrono
MyChrono2 is Chrono
// Start the first stopwatch
ChronoStart(MyChrono1)
// Start the second stopwatch
ChronoStart(MyChrono2)
// Stop the first stopwatch
DurationChronoStart is Duration = ChronoEnd(MyChrono1)
MyFunction()
// Stop the second stopwatch
DurationMyFunction is Duration = ChronoEnd(MyChrono2)
Info("The MyFunction() process lasted " + DurationMyFunction, ...
"The whole process lasted " + DurationChronoStart)
Reports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 AppUser code (UMC)
MyChrono1 is Chrono
MyChrono2 is Chrono
// Start the first stopwatch
ChronoStart(MyChrono1)
// Start the second stopwatch
ChronoStart(MyChrono2)
// Stop the first stopwatch
DurationChronoStart is Duration = ChronoEnd(MyChrono1)
MyFunction()
// Stop the second stopwatch
DurationMyFunction is Duration = ChronoEnd(MyChrono2)
Info("The MyFunction() process lasted " + DurationMyFunction, ...
"The whole process lasted " + DurationChronoStart)
Syntax

Ending the timing kept with a stopwatch number Hide the details

<Result> = ChronoEnd([<Stopwatch number>])
<Result>: Duration
Time passed (in milliseconds) since the last call to ChronoStart for the specified stopwatch number.
PHP This parameter is an integer.
<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
Reports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 AppUser code (UMC)

Ending the timing kept with a Chrono variable Hide the details

<Result> = ChronoEnd(<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
Reports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 AppUser code (UMC)

Ending the timing kept with a Chrono variable Hide the details

<Result> = ChronoEnd(<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.
Reports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 AppUser code (UMC)

Ending the timing kept with a Chrono variable Hide the details

<Result> = ChronoEnd(<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

Miscellaneous

If ChronoEnd is called twice on the same stopwatch without ChronoStart being called, the returned duration will be identical for the two calls (the stopwatch is stopped during the first call to ChronoEnd).

Error

A WLanguage error occurs ("The stopwatch is not started") if ChronoStart was not called before 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 and ChronoEnd 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).
UWA Stopwatch 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.
Component : wd240vm.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Video ChronoEnd
https://youtu.be/HsQBVdHh_PE
https://windevdesenvolvimento.blogspot.com/2019/07/dicas-2207-windev-webdev-mobile.html
//PROCEDURE CONTADOR_TEMPO()
nCONTADOR is int=0
LOOP
Message(nCONTADOR)
nCONTADOR++
IF nCONTADOR>6000 THEN
BREAK
END
END
// BTN_CONTADOR_TEMPO
ChronoStart()
CONTADOR_TEMPO()
duRacao_tempo is Duration=ChronoEnd()
Info("TEMPO:"+duRacao_tempo..Hour+"HR "+duRacao_tempo..Minute+"MI "+duRacao_tempo..Second)
amarildo
19 Jul. 2019