0
@property(readonly) NSTimeInterval timestamp;

denotes the time when the event occurred in seconds since system startup. I want to compare the timestamps of two events but their differences can also be in milliseconds. So, is there any way to get the timestamp of an event in milliseconds. I know I can use the methods mentioned in this SO question but would that be appropriate to use for events ?

sri.vats3
  • 33
  • 3

1 Answers1

1

If you want milliseconds you can multiply by 1000.0 but you can compare without multiplying. Documentation of NSTimeInterval:

typedef double NSTimeInterval;

NSTimeInterval is always specified in seconds; it yields sub-millisecond precision over a range of 10,000 years.

Community
  • 1
  • 1
Willeke
  • 14,578
  • 4
  • 19
  • 47