Skip to content

Commit

Permalink
show disk avio values in microseconds or nanoseconds as appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
db48x committed Dec 11, 2019
1 parent 802fb3a commit c20cbce
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions showsys.c
Expand Up @@ -1832,14 +1832,26 @@ sysprt_DSKAVIO(void *p, void *q, int badness, int *color)
if (tim > 100.0)
{
sprintf(buf+5, "%4.0lf ms", tim);
}
else if (tim > 10.0)
}
else if (tim > 10.0)
{
sprintf(buf+5, "%4.1lf ms", tim);
}
else
else if (tim > 0.1)
{
sprintf(buf+5, "%3.2lf ms", tim);
}
else if (tim > 0.01)
{
sprintf(buf+5, "%4.1lf µs", tim * 1000.0);
}
else if (tim > 0.0001)
{
sprintf(buf+5, "%4.2lf µs", tim * 1000.0);
}
else
{
sprintf(buf+5, "%4.2lf ms", tim);
sprintf(buf+5, "%4.1lf ns", tim * 1000000.0);
}

return buf;
Expand Down

0 comments on commit c20cbce

Please sign in to comment.