10.10.2015, 13:00
START: timecnt = 0, timestop = 300
every second:
//edit: despite counting upwards, it shows the time down: 5:00 4:59 ... 0:00
Example:
https://www.youtube.com/watch?v=desa4vyIHGs
countup, time down
every second:
PHP код:
timecnt++; // 1 2 3 4 ... 300
new timessek, timesmin;
timesmin = ((timestop-timecnt)/60);
timessek = (timestop-(timecnt+(timesmin*60)));
format(buffer,sizeof buffer,"%02d:%02d",timesmin,timessek);
//show time
if(timecnt == timestop){
//The End
timecnt = 0; //reset
}
Example:
https://www.youtube.com/watch?v=desa4vyIHGs
countup, time down