Re: Calculate the time difference using difftime yields unexpected result
Re: Calculate the time difference using difftime yields unexpected result
- Subject: Re: Calculate the time difference using difftime yields unexpected result
- From: Brian Stern <email@hidden>
- Date: Wed, 7 Mar 2007 20:52:22 -0500
I am trying to calculate the time it took for a certain task, so I
tried to use difftime, as shown in the example below. Yet when I
try to use difftime the result is double period = difftime
(endTime,startTime);
NSLog(@"PERIOD DIFF: %d",period);
The d in %d stands for decimal not double. Try %f or %g or one of
the other floating point format specifiers when printing a double.
--
Brian Stern
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden