Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (499)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  No hires timer in 1.5?  (Read 1959 times)
0 Members and 1 Guest are viewing this topic.
Offline sma

Junior Member





« Posted 2004-05-14 08:11:02 »

Just saw this on cafeaulait.org in today's news about the latest 1.5 spec:

"Features dropped since the previous draft include a high resolution timer. Comments are due by June 10."

.: Truth Until Paradox!
Offline Mark Thornton

Senior Member





« Reply #1 - Posted 2004-05-14 08:18:04 »

The feature has been partially implemented: the method System.nanoTime gives the elapsed time in nanoseconds since an arbitrary start point. The actual resolution should be the best available on the machine.
Offline Abuse

JGO Coder


Medals: 10


falling into the abyss of reality


« Reply #2 - Posted 2004-05-14 13:02:13 »

If they remove System.nanoTime(), I swear I will never program in Java ever again!

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mark Thornton

Senior Member





« Reply #3 - Posted 2004-05-14 14:34:12 »

It hasn't been removed --- the latest version of the Tiger content document now mentions that this feature remains (although other parts of the high resolution timer request were lost).
Offline Bombadil

Senior Member





« Reply #4 - Posted 2004-05-14 14:59:04 »

Quote
It hasn't been removed --- the latest version of the Tiger content document now mentions that this feature remains (although other parts of the high resolution timer request were lost).

Oh. Is there any info on which parts "were lost" and why?
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #5 - Posted 2004-05-14 15:24:29 »

"In 0.42 Feature 4614021 Provide a high resolution timer in j2se was dropped, however a small subset of that original request has been implemented as part of JSR 166 as System.nanoTime as noted in bug 4478186. "

Maybe check the bug database for bug # 4614021 to see what we won't get.



Offline abies

Senior Member





« Reply #6 - Posted 2004-05-14 19:49:30 »

Original RFE asked for accurate replacement for System.currentTimeMillis - this means nanotimer with value which means something as absolute number. Instead we 'only' get a nanoTimer which makes sense as relative value (but you cannot use it for detecting wall clock time). This means we get everything we need for games, so no reason to worry.

Artur Biesiadowski
Offline D.t.O

Junior Member




Psych'd about Java Games


« Reply #7 - Posted 2004-05-15 17:22:04 »

Just wondering, does the nano timer ever "wrap around" when it reaches a certain value?

Enjoy.
Regards,
     - D.t.O
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #8 - Posted 2004-05-15 18:30:15 »

Quote
Just wondering, does the nano timer ever "wrap around" when it reaches a certain value?


Yes, I guess so... but it doesn't matter, because it just won't happen in your whole life (or in this millenium) :>

long is -9,22*10^18 to 9,223*10^18 do the math if you want the accurate values Wink

弾幕 ☆ @mahonnaiseblog
Offline cfmdobbie

Senior Member




Who, me?


« Reply #9 - Posted 2004-05-16 12:44:38 »

*sigh*

It's a small change and certainly one we can live with, but I have to wonder what's so hard about the original design that made it impossible to implement?

Edit: By the way, I think a long-based nanosecond timer should run out in 285 thousand years, give or take a millienia or two?

Hellomynameis Charlie Dobbie.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #10 - Posted 2004-05-16 13:46:17 »

Quote


Yes, I guess so... but it doesn't matter, because it just won't happen in your whole life (or in this millenium) :>

long is -9,22*10^18 to 9,223*10^18 do the math if you want the accurate values Wink


Ah...isn't the problem though that it isn't necessarily *started* at 0? If it's "only correct for relative time" it could theoretically start initialized at any value - and that could force you to do wrap-around handling (and get some horribly hard to reproduce bugs!).

malloc will be first against the wall when the revolution comes...
Offline Jens

Senior Member




Java for games!


« Reply #11 - Posted 2004-05-16 16:23:45 »

Docs are useful:

Quote
Differences in successive calls that span greater than approximately 292 years (263  nanoseconds) will not accurately compute elapsed time due to numerical overflow.


Wrap-around handling is not required, because you will get the correct difference between two long values, even if one or both exceed the maximum value of long variables.

Xith3D Getting Started Guide (PDF,HTML,Source)
Pages: [1]
  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.

xsi3rr4x (27 views)
2014-04-15 18:08:23

BurntPizza (24 views)
2014-04-15 03:46:01

UprightPath (39 views)
2014-04-14 17:39:50

UprightPath (21 views)
2014-04-14 17:35:47

Porlus (37 views)
2014-04-14 15:48:38

tom_mai78101 (61 views)
2014-04-10 04:04:31

BurntPizza (120 views)
2014-04-08 23:06:04

tom_mai78101 (220 views)
2014-04-05 13:34:39

trollwarrior1 (187 views)
2014-04-04 12:06:45

CJLetsGame (194 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!