timer not accurate when switching scenes?

Hi, there seems to be a bug with the timer when using it to load new screens. Here is the code that I’m using:

local function goToNextScene (event)  
 storyboard.gotoScene( "scene2" )  
end  
   
timer.performWithDelay(1000, goToNextScene)  

I’m using the storyboard API in this example, but the same problem also happens when I use Director class. When I use that code to sequence through 10 screens, with a 1000 millisecond (1 second) delay in between displaying each scene, it works fine in the simulator, but on my iPod and iPad, I need to lower it to 600 milliseconds to get the one second delay I’m desiring. Just wondering if anybody else is having a similar problem with the timer being too slow? [import]uid: 82194 topic_id: 18752 reply_id: 318752[/import]

Because changing scenes means cleaning up the first scene and loading the second there could be some discrepancy there, however just doing a test build over 3 simple screens on my device it appears accurate.

How much is in each scene? [import]uid: 52491 topic_id: 18752 reply_id: 72390[/import]

Hi Peach, thanks for the reply. I actually purchased your Quiz template way back when. =) Anyway, hope you can provide me with more insight here. I created 10 simple screens in a sequence with a timer.performWithDelay of 1000 milliseconds (1 second) between launching each screen. That means that it should take exactly 10 seconds to get to the 10th screen. However, it actually ends up being around 14 seconds on both my iPad2 and iPod Touch3. Here is my file, do you think you can try testing it on your device?

http://dl.dropbox.com/u/35099921/Timer.zip

To test the accuracy of the timing, you’ll hear my voice in the background counting from 1 to 10 based on a stopwatch. However, you should see the screens taking longer than 1 second a piece to load. [import]uid: 82194 topic_id: 18752 reply_id: 72452[/import]

Oh cool - thank you :slight_smile:

I can’t make any promises with checking out your code (it’s not something I do on any official level) but if I have a little time this afternoon I’ll try and check it out and see if I can offer any guidance.

Peach :slight_smile: [import]uid: 52491 topic_id: 18752 reply_id: 72584[/import]

No problem, Peach. If anybody else in the Corona community could provide a lending hand, would much appreciate it. I’m just trying to determine if this is a bug with the timer, and if so would like to submit it as a bug to Ansca so that it can be fixed. My goal is to create a simple photo slideshow effect where each screen of the slideshow is seen for a set amount of time (1 second), then goes to the next screen. It would be timed to the beat of music, so it’s very important for the screens to switch exactly at the 1 second mark. But as you’ll see in my sample lua file, the timer is off and takes longer than 1 second each to switch screens. Anybody available to test out my file on their iPad/iPod device to confirm whether or not this is a timer bug?

http://dl.dropbox.com/u/35099921/Timer.zip

Eventually, if I can get this to work, I’ll post it in the sample code libraries for other newbies to use as a template for their slideshows. Thanks! [import]uid: 82194 topic_id: 18752 reply_id: 72819[/import]

Hey there,

I just built this and tested on iPhone4; you aren’t wrong about the delay.

Are you able to file a bug report including this code, please; http://developer.anscamobile.com/content/bug-submission

If you could post the bug number here that would also be useful.

Thanks,
Peach :slight_smile: [import]uid: 52491 topic_id: 18752 reply_id: 72885[/import]

Okay, done! Here’s the bug case number: #10566. Thanks for your assistance Peach! [import]uid: 82194 topic_id: 18752 reply_id: 73213[/import]

No worries, will pass this on to the team.

Peach :slight_smile: [import]uid: 52491 topic_id: 18752 reply_id: 73223[/import]