# How to make Frame Independent Timer Clock

I want to make a frame Independent Timer that it work consistently across different computer configuration.

• Is it game time you want to measure, or realtime? Game time can slow down or speed up if you're modifying Time.timeScale for slow-motion effects and the like. Jan 23 '16 at 16:22
• i just want to make a clock where each time is important and specific event will fire on time. additonally i want to slow and speed up the time ? is this possible Jan 27 '16 at 4:20
• Jon's answer below gets you what you need Jan 27 '16 at 7:18

// ORIGINAL TIMER COUNTDOWN IN SECONDS
const float TIMER = 3;

// TIMER CURRENT TIME
float Timer;

// RUNS ON EACH FRAME
void Update()
{
// SUBTRACT DELTA TIME FROM CURRENT TIME
Timer -= Time.deltaTime;

// TIMER WENT OFF
if (Timer <= 0)
{
//DO SOMETHING
Foo();

// RESET TIMER
Timer = TIMER;
}
}

• so this will work frame Indepently and how can i speed up Jan 27 '16 at 9:32
• @MohammadFaizanKhan you would change the TIMER value to whatever you want. I added some comments since you seem to be pretty new to this. Jan 27 '16 at 10:48