• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Calculate the time difference using difftime yields unexpected result
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Calculate the time difference using difftime yields unexpected result (From: Alexander Hartner <email@hidden>)

  • Prev by Date: Re: Calculate the time difference using difftime yields unexpected result
  • Next by Date: Re: What is the easy way to plot data?
  • Previous by thread: Re: Calculate the time difference using difftime yields unexpected result
  • Next by thread: What is the easy way to plot data?
  • Index(es):
    • Date
    • Thread