|
@@ -56,7 +56,8 @@ static struct command_descriptor time_cmd =
|
56
|
56
|
static int time_exec ( int argc, char **argv ) {
|
57
|
57
|
struct time_options opts;
|
58
|
58
|
unsigned long start;
|
59
|
|
- int secs;
|
|
59
|
+ unsigned long elapsed;
|
|
60
|
+ int decisecs;
|
60
|
61
|
int rc;
|
61
|
62
|
|
62
|
63
|
/* Parse options */
|
|
@@ -65,9 +66,11 @@ static int time_exec ( int argc, char **argv ) {
|
65
|
66
|
|
66
|
67
|
start = currticks();
|
67
|
68
|
rc = execv ( argv[1], argv + 1 );
|
68
|
|
- secs = (currticks() - start) / ticks_per_sec();
|
|
69
|
+ elapsed = ( currticks() - start );
|
|
70
|
+ decisecs = ( 10 * elapsed / ticks_per_sec() );
|
69
|
71
|
|
70
|
|
- printf ( "%s: %ds\n", argv[0], secs );
|
|
72
|
+ printf ( "%s: %d.%ds\n", argv[0],
|
|
73
|
+ ( decisecs / 10 ), ( decisecs % 10 ) );
|
71
|
74
|
|
72
|
75
|
return rc;
|
73
|
76
|
}
|