Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Failed Counter Code

Failed Counter Code

Put your problem here if it does not fit any of the other categories.

Failed Counter Code

Postby johnsearle » Wed Oct 10, 2012 5:57 am

I'm attempting to write a simple test app that counts down by the second and displays it on the screen. I have used the following to get my current results:

Code: Select all
      Time currentTime = new Time();
      currentTime.setToNow();
      
      int milliDiff = (int) (currentTime.toMillis(false) - startTime.toMillis(false));
      
      if(milliDiff > 1000) {
         startTime.setToNow();
         sec--; // in class scope to count # seconds
         millis = milliDiff;
         
         if(sec < 0) {
            sec = 0;
         } else if (sec < 10) {
            Assets.tick.play(100);
         }               
         
      }



The display code is elsewhere, and the FPS < 1 second. If I set the value of milliDiff to 500, then it seems to run at close to the proper speed.

I know there are other approaches to this problem, but can anyone explain why this fails?

Thanks.
johnsearle
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Oct 10, 2012 5:49 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests