forked from qt-creator/qt-creator
Tracing: Add space between duration and time unit
According to the SI convention, there is always a space between the number and the unit. I think we can leave it as is for the combination of multiple units for the sake of compactness. Change-Id: I11efc7ec4fc54a8adbf64e51817f2f8ad567bcea Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -30,7 +30,7 @@ namespace Timeline {
|
|||||||
|
|
||||||
QString formatTime(qint64 timestamp, qint64 reference)
|
QString formatTime(qint64 timestamp, qint64 reference)
|
||||||
{
|
{
|
||||||
static const char *decimalUnits[] = {"ns", "\xb5s", "ms", "s"};
|
static const char *decimalUnits[] = {" ns", " \xb5s", " ms", " s"};
|
||||||
static const double second = 1e9;
|
static const double second = 1e9;
|
||||||
static const double minute = 60;
|
static const double minute = 60;
|
||||||
static const double hour = 60;
|
static const double hour = 60;
|
||||||
@@ -63,7 +63,7 @@ QString formatTime(qint64 timestamp, qint64 reference)
|
|||||||
|
|
||||||
double seconds = timestamp / second;
|
double seconds = timestamp / second;
|
||||||
if (seconds < minute) {
|
if (seconds < minute) {
|
||||||
return QString::number(seconds, 'g', qMax(round, 3)) + "s";
|
return QString::number(seconds, 'g', qMax(round, 3)) + " s";
|
||||||
} else {
|
} else {
|
||||||
int minutes = seconds / minute;
|
int minutes = seconds / minute;
|
||||||
seconds -= minutes * minute;
|
seconds -= minutes * minute;
|
||||||
|
Reference in New Issue
Block a user