• How do computers measure time?
    22 replies, posted
I've always wondered how a computer tells time. If you had a faster computer, shouldn't it operate everything faster compared to a slower computer?
Quartz crystal , an RTC chip, and a battery. [img]http://www.extremeelectronics.co.in/avrtutorials/images/DS1307_RTC_Module.jpg[/img] There is honestly nothing but three components. There is also multiple crystals separating the clock speed of different buses. It's been a long time since one crystal drove the ENTIRE system (and created one hell of a bottleneck).
not really, it's just like saying if you have a higher framerate, shouldn't your games run at an increased rate which is of course, not true (for the most part)
[QUOTE=Jaehead;27323402]not really, it's just like saying if you have a higher framerate, shouldn't your games run at an increased rate which is of course, not true[/QUOTE] that is true for some games that don't use framerate for calculating time. an example is XCOM, which when not limited in dosbox will run super-fast.
[QUOTE=Jaehead;27323402]not really, it's just like saying if you have a higher framerate, shouldn't your games run at an increased rate which is of course, not true[/QUOTE] That actually happens on some games that aren't properly made, Touhou anyone?
yes, I realize now, but you get my point though, right?
Well, of course I knew that most games with higher FPS don't run at a faster timescale. I was asking why wouldn't games run at a faster timescale. There would have to be a mechanical component in there that measured time individually that the computer based it's time on.
[QUOTE=Cookieeater;27323531]Well, of course I knew that most games with higher FPS don't run at a faster timescale. I was asking why wouldn't games run at a faster timescale. There would have to be a mechanical component in there that measured time individually that the computer based it's time on.[/QUOTE] apparently the motherboard has some kind of separate battery that allow it to keep time even when the computer is off
[QUOTE=nicatronTg;27323482]Touhou anyone?[/QUOTE] And when you think Lunatic mode doesn't get any harder, it does.
I beleive it's both. The clock speed can't really vary out of spec or else the components start to bitch. I beleive the reason why games would not run at a faster timescale execution wise is because a long time ago before and during the era of the turbo button, developers designed checks in their software that made sure that if the turbo button was pressed it would make use of the faster clock/bus speed properly instead of making your applications whiz past you or cause timer-based events to screw up. I guess a good example of this is to enter the fast clock cheat in GTA III. The game runs normally (that is, at real speed) but anything related to time now zooms past (EG: the day cycle or some missions). Edited: Rated myself optimistic because this is really stumping me and my friends. I'm assuming this is something that's now integrated into software compilers.
[QUOTE=MIPS;27323625]I beleive it's both. The clock speed can't really vary out of spec or else the components start to bitch. I beleive the reason why games would not run at a faster timescale execution wise is because a long time ago before and during the era of the turbo button, developers designed checks in their software that made sure that if the turbo button was pressed it would make use of the faster clock/bus speed properly instead of making your applications whiz past you or cause timer-based events to screw up. [b]I guess a good example of this is to enter the fast clock cheat in GTA III. The game runs normally (that is, at real speed) but anything related to time now zooms past (EG: the day cycle or some missions).[/b][/QUOTE] this isn't because of the game time being tied to the framerate, though. If it was, the ingame time would depend on how fast the frames are being rendered, which it doesn't.
[QUOTE=Jaehead;27323402]not really, it's just like saying if you have a higher framerate, shouldn't your games run at an increased rate which is of course, not true (for the most part)[/QUOTE] It's extra work to avoid that. The first game I wrote had that problem. On my desktop it ran really fast, but on my laptop it ran really slow. What I ended up doing was setting a max render time of like 50ms or so and then timing how long a frame took to render then sleeping until the 50ms was up and start the next frame. Not a great solution either.
[QUOTE=Cookieeater;27323377]I've always wondered how a computer tells time. If you had a faster computer, shouldn't it operate everything faster compared to a slower computer?[/QUOTE] nope because that's not how computers work processes are based on timing. when a processor receives information it needs to process from a program there is a timer which figures out when to run what at what time this is why DOS applications run quicker or slower based on computer hardware because DOS lacks a watchdog timer if a program computes an instruction very quickly, the processor simply does nothing until the next instruction is fed, which is what results in bottle-necking due to bad coding if a program computes too slowly it will time out and either crash or hang, your windows kernel figures this out [editline]9th January 2011[/editline] [QUOTE=Cookieeater;27323531]Well, of course I knew that most games with higher FPS don't run at a faster timescale. I was asking why wouldn't games run at a faster timescale. There would have to be a mechanical component in there that measured time individually that the computer based it's time on.[/QUOTE] there are little mini-IC's every in your computer that are set to compute at an exact time in order for the computer to not lose track it can also be the crystals, which provide a correct speed 32.768khz is a 16 bit counter when it goes from 32768 to 65535 exactly one second has passed in real time [editline]9th January 2011[/editline] the coolest thing about crystals is that they operate in a very mysterious manner essentially, applying electricity to a crystal allows the internal to bounce in a specific frequency so you pretty much have a perfect clock with little cost and very little ability of failure [editline]9th January 2011[/editline] just to clarifiy, not a single program uses the RTC crystal because it has a huge error rate which would be disastrous, so they use watch dog timers
[QUOTE=Foda;27323445]that is true for some games that don't use framerate for calculating time. an example is XCOM, which when not limited in dosbox will run super-fast.[/QUOTE] There was a time before you could actually measure time with accuracy, which made it impossible to do anything else than framerate based, then someone came up with the performance counter which allowed developers to measure time accuratly enough
[QUOTE=thisispain;27323816]nope because that's not how computers work processes are based on timing. when a processor receives information it needs to process from a program there is a timer which figures out when to run what at what time this is why DOS applications run quicker or slower based on computer hardware because DOS lacks a watchdog timer if a program computes an instruction very quickly, the processor simply does nothing until the next instruction is fed, which is what results in bottle-necking due to bad coding if a program computes too slowly it will time out and either crash or hang, your windows kernel figures this out[/QUOTE] did you just make all of this up or what
[QUOTE=Catdaemon;27332981]did you just make all of this up or what[/QUOTE] no
[QUOTE=ButtsexV2;27333009]no[/QUOTE] so how come some DOS applications run properly and I still have to manually write timing code every time
[QUOTE=Catdaemon;27333125]so how come some DOS applications run properly and I still have to manually write timing code every time[/QUOTE] it's not so much DOS applications but the poor code that was around when dos was the major operating system
[QUOTE=ButtsexV2;27333603]it's not so much DOS applications but the poor code that was around when dos was the major operating system[/QUOTE] so he did make it up
[QUOTE=Catdaemon;27333125]so how come some DOS applications run properly and I still have to manually write timing code every time[/QUOTE] some DOS applications do have timers and i don't know what you are writing timing code for, windows handles that automatically when it times things [editline]11th January 2011[/editline] [QUOTE=Catdaemon;27332981]did you just make all of this up or what[/QUOTE] yeah completely, it's actually magic that times things
With internet
There is a tiny gnome in your PC called a TimeKeeper. Occasionally, you must drop jello into your DVD tray to feed him
Multiply with delta frame time.
Sorry, you need to Log In to post a reply to this thread.