Hi Schred,
Check out the millis() function.
You can find plenty of example on the forum on how to use it