High-resolution timer for the iPhone

The NSDate class is actually very high-resolution.
NSDate *startDate = [[NSDate alloc] init];
// do something
NSDate *endDate = [[NSDate alloc] init];
double seconds = [endDate timeIntervalSinceDate:startDate];
iPhone simulator: 0.001013 or 0.000983 ms accuracy (about twice as long as it takes to pull the date)
iPhone debug: between about 0.014 and 0.015 ms accuracy (it takes that long to pull the date)
The [NSDate date] might be simpler than alloc and init, but it actually takes about 3 millionths of a second longer on the simulator.

So are you asking for a way to obtain a timestamp with less latency or how to implement a timer?

Similar Messages

  • Apple: Please post an estimated up time for the iPhone 2.0/iTunes Upgrade

    Like many fellow iPhone users, I've been having a devil of a time completing my iPhone upgrade. It's stuck in iPhone purgatory awaiting a connection to iTunes to complete, and in turn, is a worthless shiny brick. If you could post an estimated time for the resolution of this problem, it would help me and many others from enduring hours or frustration and attempted workarounds (click on Music, then your phone, then music, then your phone, then the store, then the phone, click your heels three times). I work for a technology company, and we find that communicating the issue to the users is always better then letting them bang their heads against a wall asking 'why why why' while they cant get their work done.

    The GOOD news is I installed 2.0... (I've been so excited about the new Apps!!!)... The BAD news is - Now I just have an image of a USB cable and iTunes logo on my phone and an error message in iTunes: "An unknown error occurred (-4)." ...please try again later.
    More BAD news - All of these fantastic apps I've already purchased and I just want to use them, but no phone to use them on anymore. I'm sorry, but I can't live without my iPhone! I don't know where I'm supposed to be right now without my iCal... I don't know any of my friends phone numbers so I can't call them for help... I don't even know my Bank information because that was in there too.
    - Please make it work again Apple! Please

  • When will I receive my I phone 6 case which i ordered along with the Iphone6 ?As per the website it says october . How long is the wait time for the Iphone 6 case?

    When will I receive my I phone 6 case which i ordered along with the I phone 6 ?As per the website it says October. How long is the wait time for the I phone 6 case?

    While we have no idea within this Community Forum how long you would have to wait for your iPhone 6 Case, I can tell you that there would not be a "general" answer of value.  Like any product that is available in different materials and colors, the inventory varies based on what you have specifically ordered.  For example, I visited an Apple Store on the day after the iPhone 6 became available and was interested in the "Midnight Blue" Leather"  Apple iPhone 6 Case.  The store had plenty of all the other colors, but that specific case and color had sold out that morning. 

  • TS3694 Why can't I update my iPhone 4 to iOS 5.1? Every time I try it gets all the way done downloading it; however when it's processing the file the page tells me "There is a problem downloading the software for the iPhone. Network connection timed out.

    Why can't I update my iPhone 4 to iOS 5.1? Every time I try it gets all the way done downloading it; however when it's processing the file the page tells me "There is a problem downloading the software for the iPhone. Network connection timed out. Make sure your network settings are correct and your network connection is active. or try again later." and next to the file it has err = -3259. I have tried this 17 times and it won't work. My iTunes is completely up to date. I have made sure that my connection is fine and I have tried turning my firewall off with no avail. This has happened to me before but usually the update will go through after 2-3 tries, never to this extent. I don't know what to do. Help!

    Error -3259 is a network timeout error, usually. This article might help:
    http://support.apple.com/kb/TS2799

  • HT3702 why did i get charged three times for the same purchase? is it because i use my apple id on three devices.. two iphones, and ipad... and and macbook geez apple i support you enough can i just pay for one copy of the audiobook

    why did i get charged three times for the same purchase? is it because i use my apple id on three devices.. two iphones, and ipad... and and macbook geez apple i support you enough can i just pay for one copy of the audiobook

    These are user-to-user forums, you are not talking to Apple here.
    If it was an audiobook then they are one-time only downloads, to get it on your other devices you need to sync it to them and not re-download it oneach. You can try contacting iTunes support and see if they will refund or credit you for the second and third downloads : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • What time is the iPhone 6 available for pre-order in Spain?

    What time is the iPhone 6 available for pre-order in Spain?

    mcnof wrote:
    I bet someone knows...
    So? You might be in for a long wait before they tell you.

  • Is there a GPS app for the iPhone that doesn't use air or data time?

    Is there a GPS app for the iPhone that doesn't use air or data time?

    There are lots of GPS Apps in the App Store.  How do I know they don't use dada and/or air charges?

  • I purchased numbers for my mac and my iPad.  It is asking me to purchase it again (for the 3rd time) for my iPhone.  Is that correct?

    I purchased numbers for my mac and my iPad.  It is asking me to purchase  it again (for the 3rd time) for my iPhone. 
    Is that correct?

    You only need to purchase Numbers once for each OS. Have you tried connecting your iPhone to your Mac via iTunes & adding Numbers there?
    Eric,
    The iOS versions of the iWork apps are "universal' & there is no reason to have to buy the iPhone version first.

  • HT204053 i am having iphone3gs and ipod4s, is it possible the application that i have purchased in my iphone can be available in my i pod by doing payment only one time for the same application in my i phone...if yes,plz let me know hw it is possible

    i am having iphone3gs and ipod4s, is it possible the application that i have purchased in my iphone can be available in my i pod by doing payment only one time for the same application in my i phone...if yes,plz let me know hw it is possible..

    Open the App Store on your device.
    Make sure you are signed in with the same account used for the original purchase.
    Tap on Purchased from the bottom navigation bar.
    On iPhone or iPod touch, tap Updates from the bottom navigation bar, then tap Purchased.
    Locate the app in your Purchased tab.
    Tap the download button (cloud symbol)
    See also: http://support.apple.com/kb/HT2519?viewlocale=en_US&locale=en_US

  • I have been trying to update to iOS 5 and every time I hit update it says, " There was a problem downloading the software for the iPhone. The network connection could not be established."  What do I need to do to update to solve this problem?

    I have been trying to update my iPhone 4 with iOS 5 for about 30 minutes and I keep getting the same thing. It says,"There was a problem downloading the software for the iPhone. The network connection could not be established." What do I need to do to solve this problem?

    iOS: Resolving update and restore alert messages
    For error -50: See error 13 and 14: 
    Error 13 and 14: These errors are typically resolved by performing one or more of the steps listed below:
    Perform USB isolation troubleshooting, including trying a different USB port directly on the computer. See the advanced steps below for USB troubleshooting.
    Put a USB 2.0 hub between the device and the computer.
    Try a different USB 30-pin dock-connector cable.
    Eliminate third-party security software conflicts.
    There may be third-party software installed that modifies your default packet size in Windows by inserting one or more TcpWindowSize entries into your registry. Your default packet size being set incorrectly can cause this error. Contact the manufacturer of the software that installed the packet-size modification for assistance. Or, follow this article by Microsoft: How to reset Internet Protocol (TCP/IP) to reset the packet size back to the default for Windows.
    Connect your computer directly to your Internet source, bypassing any routers, hubs, or switches. You may need to restart your computer and modem to get online.
    Try to restore from another known-good computer and network.

  • IOS 5 on 3Gs iPhone,There was a problem downloading the software for the iPhone

    I have attemepted to update my iPhone 3Gs 8-10 times now over the past three days and keep getting the following error message:
    There was a problem downloading the software for the iPhone " My iPhone". The network connection timed out.
    Make sure your network settings asre correct and your netowrk connections are active, or try again later.
    This is after i wait 45-60min for iOS 5 to download each time.

    Hi,
    I am having the same problem as eimaj311 - and I dont have Kaspersky. I would like to believe that the error is not even related to network speed. I understand there would be a high demand on the servers - but this would have been anticipated and addressed - if so why the error message. I think downloading 700Mb would have been easier if iTunes can save whatever was downloaded and resume from that point in the event an error occurs.
    In the mean time I am doomed - looks like the timeout error messages are there to stay.

  • Is this the default brightness setting for the iPhone?

    I found this on the apple website and was wondering if this is the default/factory brightness setting for the iPhone. http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT5506/HT5506_01---- en.png

    midilance wrote:
    What audio settings should I set mine to?  Digital Performer.  16 or 24 bit?
    24 bit is the higher resolution, GB can be set to use this bit depth in its preferences
    midilance wrote:
    24 or 48 Khz?
    neither, GB only support a 44.1k sample rate

  • Can i use my husbands upgrade for the iphone 6 promotion

    My line is technically not eligible for upgrade, but my husbands line is (we are on a family plan with my mom). Last time I upgraded, they let me use my husbands upgrade since his was available. Can I do this for the iphone 6 promotion or will they not allow it?

    Can I transfer upgrade eligibility from one line to another?
    If you have multiple devices on your account and one is eligible for an upgrade, you can transfer upgrade eligibility to another line on your account whenupgrading your device in My Verizon. When you transfer eligibility from one line to another, the original line is no longer eligible for the upgrade discount.
    To transfer upgrade eligibility from one line to another line on your account:Go to the Upgrade Device page in My Verizon.
    Click Transfer Upgrade.
    Note: If the Transfer Upgrade link isn’t appearing, you may not be eligible to transfer an upgrade at this time
    Select the mobile number you want to upgrade. This will transfer upgrade eligibility to that line.
    Select the device you want to upgrade to and click Next.
    Follow the onscreen prompts to complete the remaining steps to upgrade your device.
    You’ve successfully transferred your upgrade eligibility to another line.

  • How do i convert my imovie trailer for the iphone 4 to other file formats?

    I'm due to make a comical presentation in 2 days, and i downloaded iMovie for the iphone 4, and would like to use the trailers created as part of the presentation.
    I'm on windows xp, and have sent the file to itunes, gone into the file sharing part, added it, saved it, and even synched the flipping thing and yet it wont even play in itunes??? thats driving me mad as it is??
    Not really bothered about that....My real main concern is wanting to play the movie file in an AVI/MOV/MP4 etc format, and have even downloaded various video conversion packages to try an convert and playback my results, but once again, and a few hours wasted, I find myself facing another brick wall.
    Is it even possible to playback the imovie trailers created in a more generic video format for others to see??
    I really do hope so!!!!
    If not, then apple, i want my £2.99 (about $5.50) back, coz that would be as pointless as a paper ashtray.
    I hope ive not had my pants pulled down and wasted my money an time on this.
    Please someone help me, or put me out of my misery.

    Actually, scrap that one girls. Ive figured it out. For those who have a similar prob, just make sure you have quicktime installed. plug ur iphone into ur pc as normal, and choose the camera an scanner options that appears auto on ur window. select the trailer u wish after the usual wizard talk through and then "ok" or "apply" or whatever the button is called. select your destination folder, and walaa. its all done, and converted into .MOV format.
    NOTE:  When saving ur trailer on ur phone, and it asks what file size, chose the Medium one, or it takes ages to open.....unless ur comp is super fast, and not like my craptop.

  • Does anyone know of an e-reader app for the iphone that has text to speech capability? I have a Kindle 3G that can read whole pdf documents and books but I cannot figure out how to do it on my iphone 4.

    Does anyone know of an e-reader app for the iphone that has text to speech capability? I have a Kindle 3G that can read whole pdf documents and books but I cannot figure out how to do it on my iphone 4.
    All of the apps I have found on the App store either do not have the text to speech capability or if they have it they will only read a page at a time or simply read the text you paste into their window. I really do not understand what is so difficult about having this feature as Kindle provides it--though Amazon does not make the feature available on its iPhone 4 app.
    Please help.

    thanks. yes i am aware of the VoiceOver feature but it is NOT the solution to my problem. as you said, it is a solution to a different set of issues. i want the text to speech ability because i there are books i need to read but do not have the time to sit down and read them and have become used to listening to them read to me either by a professional human reader or with the text to speech software on the Kindle.
    I think Apple makes the best audio devices but i am really disappointed in this inexplainable shortcoming. if apple can give us siri they ought to be able to design a nice little button that i can push to turn on text to speech while i am in a document, book, magazine or webpage. clearly it is possible as apple has added the "reader" button in safari to have web pages dropped into the reader format.
    thanks for your suggestion though, it is what everyone suggests but it does not address the issue.

Maybe you are looking for

  • File deliverable concern in FTP

    Hi All, We have a scenario where we sending the files to FTP with comma delimeted. Now requirement saying that : There is a another file (called .cksum) should write no.of records , filesize, filename in 2nd file based onfirst file(File1.txt) records

  • WRT1900AC being used in small network

    I've been using the WRT 1900 AC in a wireless configuration to support one laptops wireless internet access.  Now I'd like to add it to a small network consiting of a laptop that is hard wired to network along with 10 other workstations all wired thr

  • Installing oracle 9i administrator version on windows XP Professional ,

    Pls provide step by step detail on how to install oracle 9i adminstrator , as i am new to oracle 9i developer track. i already inistalled , but it is askinme for port no? etc... pls help ..

  • Can You change a classic folder to OSX folder So that CS2 will open it ?

    Can You change a classic folder to OSX folder So that CS2 will open it ? I have KPT6 plugin for photoshop,but will install as classic folder, and CS2 will not open it. PowerMac G5   Mac OS X (10.4.8)  

  • Advice needed on upgrading to Yosemite and SSD simultaneously

    I am upgrading my early 2011 MacBook Pro replacing my 320gb HDD with a 500GB SSD drive and upgrading RAM from 4gb to 16gb. The question is, should I do a clean install of Yosemite to the SSD and use migration assistant to recover apps and data from T