Search code examples
timewindows-store-apps

Obtaining ticks from system boot in Windows Store app


PointerPoint.Timestamp property contains time relative to the system boot time, in microseconds. I am looking for a way to get current time in compatible format. Also time from system boot will be a more efficient way to work with time intervals than DateTime.Now.

Window API has functions like GetTickCount and GetTickCount64, but they are unavailable for a Windows Phone. Is there something similar for a Windows Store App?


Solution

  • Use System.Environment.TickCount instead.