Re: needed Time for a method
Re: needed Time for a method
- Subject: Re: needed Time for a method
- From: Claudius Sailer <email@hidden>
- Date: Sat, 21 Sep 2002 10:38:20 +0200
Am Samstag, 21.09.02 um 01:34 Uhr schrieb David Remahl:
You can use NSDate:
NSDate *start = [NSDate date];
// do stuff
usleep(1000);
NSLog(@"Time passed (in seconds, with decimals): %f", [[NSDate date]
timeIntervalSinceDate:start]);
The reason your code is not working, is that double is not an object
but a C
variable. It does not respond to messages. The timestamp method you
found is
related to NSEvent, and used to determine the time at which an event
occurred.
I tested NSDate before I found timestamp, but I always got seconds as
result. Thats not fine enough. Now I found the bug in my way.
I used
NSLog(@"Time passed (in seconds, with decimals): %d", [[NSDate date]
timeIntervalSinceDate:start]);
now I know why I only get seconds ;-))
Thanks for help
Claudius
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.