• 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: Newbie simple question - Get Time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie simple question - Get Time


  • Subject: Re: Newbie simple question - Get Time
  • From: Denis Stanton <email@hidden>
  • Date: Wed, 9 Apr 2003 20:29:51 +1200

On Wednesday, April 9, 2003, at 07:27 PM, Sebastien TOPIN wrote:

I just need to know how to get the current time with Cocoa. I want to measure
time used for a calculation.

If you put an NSLog message before and after the section you want to time you can read the times from the output log. Unfortunately printing out the NSLog message takes significant time so you shouldn't put any log messages like this inside the section you are timing.

NSLog(@"starting now");
<my code>
NSLog(@finished");

will produce something like this in the top right panel of Project Builder

2003-04-09 20:23:45.204 MyApp[1217] starting now
2003-04-09 20:23:45.357 MyApp[1217] finished

The lines above give the time down to milliseconds.

Denis
_______________________________________________
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.

References: 
 >Newbie simple question - Get Time (From: "Sebastien TOPIN" <email@hidden>)

  • Prev by Date: Re: Implementation of a server or a daemon in Cocoa
  • Next by Date: Re: Newbie simple question - Get Time
  • Previous by thread: Newbie simple question - Get Time
  • Next by thread: Re: Newbie simple question - Get Time
  • Index(es):
    • Date
    • Thread