Input NSTimer compare

Discussion in 'iOS Programming' started by jim93, Aug 5, 2009.

  1. jim93 macrumors newbie

    Joined:
    Jun 27, 2009
    #1
    I was wondering what would be the best way to compare the time an input has been received and the time a recurring action by NSTimer. How could i know when the input has been received relative to the NSTimer event I programmed?
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    Code:
    NSTimeInterval	now = [NSDate timeIntervalSinceReferenceDate];
    
    Just save those and subtract.
     
  3. jim93 thread starter macrumors newbie

    Joined:
    Jun 27, 2009
    #3
    I get it you mean I add that in my event handler for my input and in my timer loop and subtract when I want to compare.

    cool. I get it. thank you.
     

Share This Page