N
NoFontNL
Guest
Hi, as you read in the title, I'm asking for help with conversion of milliseconds to the hh:mm:ss:ms version.
This is my code now, but it is pretty messed up.
Output > 00.00:00.00:00.00.00.00 // and then it's going up randomly.
Note:
Game FPS: 60;
Create:
theTime=0;
Step:
theTime++;
Draw:
draw_text(x,y,scMsToTime(theTime));
The seconds don't go up by seconds, there's a little delay.
Any help would be appreciated.
This is my code now, but it is pretty messed up.
Code:
/// @desc scMsToTime(milliseconds);
/// @arg milliseconds
var milliseconds = argument0;
var ms = ((milliseconds % 1000) / 100),
seconds = ((milliseconds / 1000) % 60),
minutes = ((milliseconds / (1000 * 60)) % 60),
hours = ((milliseconds / (1000 * 60 * 60)) % 24);
if(hours<10) hours="0"+string(hours);
if(minutes<10) minutes="0"+string(minutes);
if(seconds<10) seconds="0"+string(seconds);
if(ms<10) ms="0"+string(ms);
return string(hours + ":" + minutes + ":" + seconds + "." + ms);
Note:
Game FPS: 60;
Create:
theTime=0;
Step:
theTime++;
Draw:
draw_text(x,y,scMsToTime(theTime));
The seconds don't go up by seconds, there's a little delay.
Any help would be appreciated.