locked
Missing NSProcessInfo systemUptime ? RRS feed

  • Question

  • User323 posted

    Hi,

    It seems very much like the native NSProcessInfo systemUptime method is missing in the Monotouch bindings.

    Is there another way to get a system timestamp ? Or is there a way to access this method in NSProcessInfo?

    ( I need to calculate time differences between timestamped UIEvent generated by touches and some other event determined by the app' logic. )

    Thank you, Laurent

    Friday, March 1, 2013 11:09 PM

All replies

  • User2047 posted

    Until the binding gets added, you can use the following:

    double uptime = MonoTouch.ObjCRuntime.Messaging.Double_objc_msgSend(NSProcessInfo.ProcessInfo.Handle, new MonoTouch.ObjCRuntime.Selector("systemUptime").Handle);

    Monday, March 4, 2013 6:43 PM
  • User323 posted

    Works great! Thanks!

    Monday, March 4, 2013 6:49 PM
  • User1044 posted

    @rolf implemented this yesterday and so should be available in an upcoming release of Xamarin.iOS (although probably not the next public release since it is already in QA).

    Tuesday, March 5, 2013 7:49 PM