((Date.Now-start)/1000) is the number of seconds passed since the start of countdown. You can do whatever you need with this number. For example compare if it's >=20, this means that 20 seconds has passed.
See this demo on how to format the time:
zeropad(floor(minutes - round((Date.Now-start)) / 60000 % 60),2) & ":" & zeropad(floor(seconds - round((Date.Now-start))/1000 % 60),2)
Thanks Dop! So after awhile of testing, I've decided to use the logic above, it uses 2 variable though one minutes, and another one for seconds, but it gets the job done, except that I do know it's extremely flawed. But atleast it's real-time. I am attempting to write a logic to make it so when both the seconds and minutes var = 0, it will stop the game next.
PS: Anyway I just thought of another issue that hopefully you may be able to answer me :c..
So these are the scenario:
1) My database has 10 rewards , lets call this Reward X. So these 10 rewards are loaded into my global variable through AJAX.
2) A player plays my game, and win a reward X, so i will subtract 1 from reward X, and update my database. Now my database has 9 rewards left.
3) My timer of 15minutes starts counting down, and within these 15minutes, if you do not provide me your address, the reward goes back into the pool (I'll be doing add 1, and update it through AJAX).
4) When the 15minutes timer starts counting down and you close your browser (Forcing the game to close as well), I want the reward to go back into my database as well.
^ So based on the above scenario, is it possible to do #4? Or should I rewrite my logic to make it so, I do not deduct the rewards first, but instead to detect it on the 3rd step, where if the player actually inserts their address in step 3, then only I will deduct the reward.