(RS) hi-res clock function
(RS) hi-res clock function
- Subject: (RS) hi-res clock function
- From: Roland Silver <email@hidden>
- Date: Wed, 25 Oct 2006 05:48:02 -0600
The following code snippet reveals that the time elapsed between one
invocation of [NSDate date] and an immediately following one can be
as little as 2 usec (on my Powerbook G4).
A related experiment shows that the resolution of the GNU clock()
function on the PowerBook is no less than 16 usec.
Is there a function like clock() that returns time (since some
origin) directly to a finer resolution than clock does?
NSDate *start, *stop;
start = [NSDate date];
stop = [NSDate date];
NSTimeInterval elapsed = [stop timeIntervalSinceDate:start];;
NSLog(@"elapsed=%g", elapsed);
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden