Hello.
I have some “finish” time in ms. (for example 14000 [14s]). Also I have others guy time like 16789ms. I have made function to math difference between times.
[code]function format_time($t) // t = miliseconds
{
$t1 = 16789;
$t2 = 14000;
$t = $t1 - $t2;
$minutes = floor($t / 60000);
$seconds = sprintf(’%02d’,floor(($t / 1000) % 60));
$ms = sprintf(’%03d’, $t % 1000);
return $minutes . “:” . $seconds . “.” . $ms;
}
echo "+ ";
echo format_time($t);
[/code]
So it will be “+ 0:02.789”
I still have a problem yet. I need to make this script mathing more than 1 time. I need around 20 other times to be mathed with 1st finish time and the difference to be displayed. And that’s my problem.
Can you give me examples or clues how can I give this script values in ms? Then, it should math every value and echo it somewhere. Can you help me in it, please?