Release HH:MM:SS to Seconds Function

vRice

Well-Known Member
Messages
57
Points
218
Another quick release for you guys, basically if you want a loop to wait for a certain amount of time and you don't wanna convert it to seconds yourself you can use this bad boi.

Here's the code:
Code:
hmsConvert(time)
{
    array = strTok(time, ":");
    return int((int(array[0]) * 60 * 60) + (int(array[1]) * 60) + int(array[2]));
}
Call it like so:
Code:
exampleLoop()
{
    while(true)
    {
        self iPrintLn("Howdy");
        wait hmsConvert("00:05:00"); //Hours, Minutes, Seconds
    }
}
 
Last edited:
Top