Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (512)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  System.nanoTime(): good or evil?  (Read 6092 times)
0 Members and 1 Guest are viewing this topic.
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #30 - Posted 2007-05-04 15:58:09 »

>you realize that it's only a problem on multi-core cpus?

Heh. That would be nice. But there are a dozen different issues with QPC.

I got a single core and QPC is unusable (QPC leaping).

弾幕 ☆ @mahonnaiseblog
Offline fletchergames

Senior Duke





« Reply #31 - Posted 2007-05-04 18:01:48 »

did you read the whole thread? you realize that it's only a problem on multi-core cpus? Sorry if you are talking about them, I got impression that you aren't.

When using System.nanoTime() on my computer with a single-core CPU, the game I wrote would suddenly pause for about half a second every once in a while (about once per level).  When using the millisecond timer instead, this problem stopped.

So System.nanoTime() has problems on single-core processors (or at least on mine) as well.  System.nanoTime() is evil.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #32 - Posted 2007-05-05 00:44:00 »

I've talked with some other (non-java) developers about the issue, and all of them (okay, they were just 3 people Smiley) use 1ms timing instead of QPC for exactly the same reasons.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Kova

Senior Duke





« Reply #33 - Posted 2007-05-05 09:18:01 »

damn Sun developers, why did they used damn QPC Smiley ... is there a RFE or bug report on this? It has to be.
I've heard LWJGL times is good, why don't they just use that, or whatever it's based on.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #34 - Posted 2007-05-05 11:39:22 »

..I suppose because the RFE it was based on required high precision, and LWJGL's timer is just 1ms.
I'd rather see a currentTimeMillis implementation with 1ms precision on Windows.

Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #35 - Posted 2007-05-05 22:03:17 »

Somehow, I would like to see that. However, since TGT is something completely different (and may not work properly on some systems, too) a new method would be required if you don't want to create regressions.

The most logical name would be...
System.milliTime() (although... I would like msecTime() more Wink)

弾幕 ☆ @mahonnaiseblog
Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (50 views)
2014-10-17 03:59:02

Norakomi (39 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (36 views)
2014-10-15 16:18:58

TehJavaDev (66 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (55 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (43 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!