Direct MLTime or C# System.Time call for system time monotonic clock?

Hello Everyone,

I've been using the MLTime conversion call MLTime.ConvertMLTimeToSystemTime to convert timestamps from GazeRecognition back to the units of the system clock. In practice, these timestamps look similar with difference of about 5.5 seconds.

The documentation mentions the conversion to system time giving a value consistent with the monotonic system clock, so my question is this: what is the most direct ML-approved call to return the instantaneous value of this clock?

Right now, I have a hacky solution where I get an MLTime using a GazeRecognition API call then convert, but I know I'm losing precision. Can MLTime provide the instantaneous system clock without converting like this?

Is there a C# call in the System.Time or System.DateTime family to return this value?

A couple of lines of C# with the right approach here would help, thanks!! Really enjoying working with the device, it's a gem.

1 Like

Thanks for being patient while we were working through our release last week. We're all back now. I'm asking around internally to see if I can get a good response regarding the best time methods to use.

1 Like

I appreciate it, Shane. I pinged Rafael Wiltz and he suggested making a call to clock_gettime as defined in time.h ... another possibility is the C# utility System.Diagnostics.Stopwatch.GetTimestamp(), will work through the options.

1 Like