PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Error
  • Threads and parallel tasks
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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:
New in version 28
Android Chrono variables are now available for Android applications. The syntax for handling Chrono variables also becomes available.
Android Widget Chrono variables are now available in Android widget mode. The syntax for handling Chrono variables also becomes available.
Java Chrono variables are now available for Java applications. The syntax for handling Chrono variables also becomes available.
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)
Reports and QueriesWindowsLinuxUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJavaUser 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

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.
Reports and QueriesWindowsLinuxUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystJavaUser code (UMC)

Timing with a Chrono variable Hide the details

ChronoStart(<Stopwatch>)
<Stopwatch>: Chrono variable
Name of the Chrono variable that corresponds to the stopwatch to use.
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.
Business / UI classification: Neutral code
Component: wd280vm.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Video ChronoStart
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