Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6859915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:20:35+00:00 2026-05-27T02:20:35+00:00

I have a timer that counts the time of my audio. I would put

  • 0

I have a timer that counts the time of my audio.
I would put a label text on the screen when you get a time:

- (void)updateTime:(NSTimer *)timer
{

    currentLocation = audio.currentTime;
    [lblCurrentLocation setText:[NSString stringWithFormat:@"%.4f Sec",currentLocation]];

    if (currentLocation == 4.7404)
    {
        [lblMsg setText:@"Sound p 1"];
    }

}

This IF is to compare CurrentLocation with 4.7404 is not working. Does anyone have any idea?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:20:36+00:00Added an answer on May 27, 2026 at 2:20 am

    You cannot reliably get the timer to call your updateTime: method after exactly 4.7404 seconds. The iPhone does not guarantee any particular level of accuracy for timers.

    Also, it takes time for iOS to turn your “Sound p 1” string into a bitmap and put it in the framebuffer. So even if you got called at exactly 4.7404 seconds, it would be later before the frame buffer was updated.

    Also, the iPhone’s LCD display has a non-zero response time. So after iOS updates the framebuffer, it will take time for the pixels on the screen to change.

    Also, humans cannot detect changes at a .0001 second level of accuracy. So even if the pixels changed completely at exactly 4.7404 seconds, the user couldn’t tell that it didn’t happen at 4.739 seconds or at 4.741 seconds.

    So what you are demanding is silly.

    You should just display your message as soon as possible after at least 4.7404 seconds have elapsed:

    - (void)updateTime:(NSTimer *)timer
    {
        // Give your object a BOOL didSeeImportantTime property.
        if (!self.didSeeImportantTime) {
            currentLocation = audio.currentTime;
            if (currentLocation < 4.7404) {
                [lblCurrentLocation setText:[NSString stringWithFormat:@"%.4f Sec",currentLocation]];
            } else {
                self.didSeeImportantTime = YES;
                [lblMsg setText:@"Sound p 1"];
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an NSTIMER that counts the time, and on t = 10, it
I have a timer that counts up from the time a user encounters that
For example I have an app that counts how many time Camera button was
I have a timer tick that I would like to kick off my backgroundworker
In my app I have a timer that counts down, and when it stops
I have a little project that is a timer that counts down 'til midnight,
I am trying to take have a time that counts down all the way
i would like to have program a timer that will count the seconds during
I have a function (frequency) which that counts how many times each distinct value
I have a timer that needs to not process its elapsed event handler at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.