The system time function time(0) gives me a resolution of 1 second, right?
Is there a finer-grained function?
I'm using it to determine the time interval between two events.
A line of code would help me greatly. It makes it easier to have something concrete to hang the concept on when I look in the official documentation.
See CFAbsoluteTimeGetCurrent:
CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
// do something you want to measure
CFAbsoluteTime end = CFAbsoluteTimeGetCurrent();
NSLog(@"operation took %2.5f seconds", end-start);
Should you find CFAbsouteTime
too verbose, you can simply use double
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With