From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

System.Ticks() As Integer

New in 2019r2

Supported for all project types and targets.

Returns the number of ticks (60th of a second) that have passed since the user’s device was started.



Part Type Description
result Integer The number of ticks that have passed while the device is operating.


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.")

See Also

System.Microseconds method