• 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: Automatic format of "time remaining" messages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatic format of "time remaining" messages


  • Subject: Re: Automatic format of "time remaining" messages
  • From: Scott Anguish <email@hidden>
  • Date: Fri, 5 Dec 2003 00:45:26 -0500

On Dec 4, 2003, at 8:17 PM, Daniel Aarno wrote:

For example when the finder performs a lengthy copy task it displays the estimated time remaining. This is displayed in an "inexact" manner, e.g. About 5 minutes remaining. This is good because it avoids the "flickering" that occurs when the estimate is not exact (as it seldom is because it's an estimate) and the ETA may change from 02:34 to 02:45 between updates. Now to the question:

Is there a way to automatically get these type of "inexact" time remaining messages from say an NSTimeInterval or an NSDate? If there is I assume it is in the correct localized version.



I don't think there is.. but it's really just figuring out the time between the two and rounding to minutes..

estimatedTimeInSeconds=500;
startTime=[NSDate date];

then periodically check the time

timeInterval=estimatedTimeInSeconds-[[NSDate date] timeIntervalSinceDate:startTime];

the time interval is in seconds remaining, so either round that, or div it.. compare it to the current time if the time hasn't changed enough, update the display..

be sure to allow for it taking longer than you expected.. :-)
_______________________________________________
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: 
 >Automatic format of "time remaining" messages (From: Daniel Aarno <email@hidden>)

  • Prev by Date: Re: Note from your listmom, re: Macintosh Products Guide
  • Next by Date: Re: NSTextField has cursor in it?
  • Previous by thread: Automatic format of "time remaining" messages
  • Next by thread: Note from your listmom, re: Macintosh Products Guide
  • Index(es):
    • Date
    • Thread