Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Is a thousandth of a second enough time?

Author
Message
Zeal
23
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 11th Sep 2003 17:19
Im working on the timer()/looptime# code in my game, and im having trouble with insanely high loop speeds. Because timer() only gives you time in thousandths of a second, many of my loops return a 'looptime#' of 0, forcing me to guesstimate a looptime# of 0.001. This isnt a big deal at low fps/loopspeeds, but it does cause problems the faster the program runs, over long periods of time.

Is this just a limit in db, or is it a limit in all languages? I realize time is infinite, and there will always be a 'time' that you cant calculate, but thousandths of a seconds seems like it might not be accurate enough for some precise calcs at very high speeds.

Not that big of a deal I guess, I can always just cap the fps at a couple hundred or whatever. Just curious.

All you need is zeal
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 11th Sep 2003 17:30
You could use the high precision timers - see what IanM's got on his web site...


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 11th Sep 2003 18:49
Quote: "I can always just cap the fps at a couple hundred or whatever."

er ok! right! , I don`t see that you will be capping any sizeable game at "a couple of hundred" fps, you will most likley end up struggling to reach 60fps on any large project, pro is fast and the speed it executes small test pieces may have lulled you into a false sense of security, but by the time you have decent models, textures, animation, AI, audio, effects, bullets, collision and a hud you will be wishing for more speed, not less, don`t worry about thousandths of a second, for nearly all cases they will be more than enough.

Mentor.
Zeal
23
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 11th Sep 2003 20:03
Heh I know its no big deal like I said, just was thinking from a 'anal, ruler up my butt' standpoint.

All you need is zeal
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 11th Sep 2003 21:52
theres a DOS level system counter that runs in thousandths. so I guess that is where the timer is getting the data from, it would be easy, modern cpu`s run at near microwave frequencies, so there must be higher rates, it`s just if the software can read the registers (although I expect they can), your other option is like we did in the old days...hand crafted and tuned delay loops (anyone remember the Spectrum clock example?)

Mentor.

Login to post a reply

Server time is: 2026-07-23 15:49:47
Your offset time is: 2026-07-23 15:49:47