Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by NicolasLIATTI · Mar 09, 2013 at 05:23 PM · fpsiphonecounter

FPS + Time.time not accurate on iPhone5

Hi,

I'm fighting with Time.time on iPhone5... I'm displaying the time with the following code:

 function Udapte(){
     timecount = Time.time - startTime;
     min = (timecount/60f); // Get the minutes
     sec = (timecount % 60f); // Get the seconds
     fraction = ((timecount * 100) %100);
     GUI.Box (Rect (10,10,110,50), String.Format(Time.time + '') );
 }

However, it goes slower than the real time when I compare it on my watch. I thus decided to monitor the framerate with the following code (from the wiki), as it seems that Time.time is framerate dependant.

 function Update()
 {
     timeleft -= Time.deltaTime;
     accum += Time.timeScale/Time.deltaTime;
     ++frames;
  
     // Interval ended - update GUI text and start new interval
     if( timeleft <= 0.0 )
     {
           displayFPS = accum/frames;
         timeleft = updateInterval;
         accum = 0.0;
         frames = 0;
     }
 }

No matter what I do, I ALWAYS get 50 fps on my iPhone 5, and it's never changing. On my iPad mini however it's variating around 50. But on iPhone 5 it seems like stuck to 50. It works also fine in the editor, meaning that the fps is variating between 59 and 60. I tried to change VSync, but no matter the value (0,1,2) it stays at 50 fps :/

What should I change to have the real time in seconds displayed and not a time which is slower than the real one) and the right FPS? The timescale is at 1, and it's not changing in game...

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jogo13 · Mar 09, 2013 at 11:54 PM 0
Share

You might try this script to see if you get different results: http://wiki.unity3d.com/index.php?title=FramesPerSecond

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by NicolasLIATTI · Mar 09, 2013 at 11:56 PM

Hi,

When this is the script I am using. but I finally found the problem, it came from the fixedtimestep in the Time manager that was too low. I put it higher and now everything is normal :)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

does the iPad have a max FPS 2 Answers

Is there a way to create applications that run on fixed frame rate of 60fps on iOS? 1 Answer

Frames per second capped at 30 for iPhone? 1 Answer

frames per second on iphone 1 Answer

What could possibly be wrong with this simplest-possible FPS counter? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges