This commit is contained in:
Fabien Potencier 2011-10-21 16:46:37 +02:00
parent 842ac36f33
commit b95fe53bf4
2 changed files with 5 additions and 5 deletions

View File

@ -221,10 +221,10 @@
context.font = "12px sans-serif";
var text = event.name;
var ms;
if (event.totaltime == 0) {
ms = " < 1 ms";
} else {
if (event.totaltime < 1) {
ms = " ~ " + event.totaltime + " ms";
} else {
ms = " ~ " + parseInt(event.totaltime) + " ms";
}
if (x + event.starttime * ratio + context.measureText(text + ms).width > width) {
context.textAlign = "end";

View File

@ -139,11 +139,11 @@ class StopwatchEvent
$total += $period[1] - $period[0];
}
return (int) sprintf('%d', $total);
return sprintf('%.1f', $total);
}
private function getNow()
{
return (int) sprintf('%d', microtime(true) * 1000 - $this->origin);
return sprintf('%.1f', microtime(true) * 1000 - $this->origin);
}
}