• 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: Time elapsed how-to ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Time elapsed how-to ?


  • Subject: Re: Time elapsed how-to ?
  • From: "Erik M. Buck" <email@hidden>
  • Date: Mon, 13 May 2002 12:47:33 -0500

NSTimeInterval _myStartTime = [NSDate timeIntervalSinceReferenceDate];

NSTimeInterval _currentTime;

// do something time consuming

_currentTime = [NSDate timeIntervalSinceReferenceDate];
printf("The time it took: %d\n", currentTime - myStartTime);

This has sub-millisecond accuracy.


See also gettimeofday().

----- Original Message -----
From: "Francis bouchard" <email@hidden>
To: "cocoa-dev" <email@hidden>
Sent: Monday, May 13, 2002 11:29 AM
Subject: Time elapsed how-to ?


> Sorry for the silly question, but I've been looking in the docs for an
hour!
> If I want to do some performance testing how do I calculate the time
passed
> during 2point in my program.
>
> Action 1;
> Start timer
> ...
> ...
> ...
> Action x
>
> Stop timer
> Compute the time that is took.
>
> thanks
> _______________________________________________
> 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.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Time elapsed how-to ?
      • From: Francis bouchard <email@hidden>
References: 
 >Time elapsed how-to ? (From: Francis bouchard <email@hidden>)

  • Prev by Date: Re: Document with multiple windows
  • Next by Date: Re: Time elapsed how-to ?
  • Previous by thread: Time elapsed how-to ?
  • Next by thread: Re: Time elapsed how-to ?
  • Index(es):
    • Date
    • Thread