If a computer is powerful enough, how does it know not to play videos or perform logic for games at a faster speed?

1.20K views

I don’t know if I’m explaining this right…
A computer can run logic at some speed based on how powerful the components of it are, so if it can perform the logic of something, for example, movement in a game, how does it know how much should be done based on its power, instead of essentially running in “fast-forward” or conversely in slow motion?

In: 1307

40 Answers

Anonymous 0 Comments

So a computer keeps exact time via an RTC which is a fancy name for a vibrating crystal that is seperate from the cpu itself.
As a program is running, it has something called a “tick rate” which is basically the rate at which a particular loop is able to run. The exact amount of time it takes for that loop to take is calculated using that RTC. For things like videos or games, or anything else that needs to happen at a speed specific for human interaction, that loop makes sure that it only triggers the next step of something in line with the tick rate as adjusted by the RTC.

Basically the program goes “ok this tick took this long…and i know i need to wait only BLAH amount of time to show the next frame…ok…loop..go around 5 more times…but don’t do anything…and then come back to me”.

You are viewing 1 out of 40 answers, click here to view all answers.