System.Ticks
From Xojo Documentation
Method
Returns the number of ticks (60th of a second) that have passed since the user’s device was started.
Syntax
result=Ticks
Part | Type | Description |
---|---|---|
result | Integer | The number of ticks that have passed while the device is operating. |
Notes
Because modern operating systems can stay running for so long, it's possible for the device's internal counters to "roll over." This means that if you are using this function to determine how much time has elapsed between two events, you may encounter a case where it appears that the stop time is prior to the start time.
Sample Code
This code displays in message box the number of minutes the device has been on.
Var minutes As Integer
minutes = System.Ticks / 60 / 60
MessageBox("Your device has been on for " + minutes.ToString + " minutes.")
minutes = System.Ticks / 60 / 60
MessageBox("Your device has been on for " + minutes.ToString + " minutes.")
See Also
System.Microseconds method