Public Group

#### Archived

This topic is now archived and is closed to further replies.

# determine processor speed

This topic is 5381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

how can i determine the processor speed so that i can slow my game down to the right time for what ever system it runs on ?

##### Share on other sites
don''t determin the processor speed... instead use the frame rate

##### Share on other sites
You don''t have to do that.

Personally, I just calculate the time spent between 2 frames and multiply it with whatever I want to move.

Exemple:
int timeFrame;int timeLastFrame;bool MyFrame(){ // timeGetTime() is a window function, it returns current // time in milliseconds timeFrame = timeGetTime()-timeLastFrame; timeLastFrame = timeGetTime(); //Do a lot of stuff here //Draw graphics //Player sound //Get input //etc.. //Move player if he press left arrow if( getKey(LEFT_ARROW)==true ) //Left arrow pressed   PlayerX += 10*timeFrame;}

if the user has a good processor and timeFrame is equal to 2 ( 2 milliseconds )
PlayerX will have increased of 20 ( 10*2 ) overs 2 milliseconds
20/2 = 10, player is moving of 10 units per milliseconds

if the user has a bad processor and timeFrame is equal to 10 ( 10 milliseconds )
PlayerX will have incresed of 100 ( 10*10 ) over 10 milliseconds
100/10 = 10, player is moving of 10 units per milliseconds

So they are both moving at the same speed

##### Share on other sites
Yeah, there''s a lot more to game speed than what speed the processor is running at. Memory latency and bandwidth, GPU performance, multitasking, etc... you don''t get a good measure of how fast your app will be running except by timing it.

"Sneftel is correct, if rather vulgar." --Flarelocke

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 12
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633315
• Total Posts
3011329
• ### Who's Online (See full list)

There are no registered users currently online

×