diff options
| author | Kenneth D. Merry <ken@FreeBSD.org> | 2013-04-10 16:01:45 +0000 |
|---|---|---|
| committer | Kenneth D. Merry <ken@FreeBSD.org> | 2013-04-10 16:01:45 +0000 |
| commit | ffc3b12c071d0fcedcda14fe0bfc3b877e6edc52 (patch) | |
| tree | 83ccb1d7c38eba4e29acd6841884d34b744c0da0 /usr.bin/ctlstat | |
| parent | 7f15a8dff2c3d92c6c598d51d32b3077fbf7a061 (diff) | |
Notes
Diffstat (limited to 'usr.bin/ctlstat')
| -rw-r--r-- | usr.bin/ctlstat/ctlstat.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ctlstat/ctlstat.c b/usr.bin/ctlstat/ctlstat.c index 1462ab9679c2..ff67bf6ad6a5 100644 --- a/usr.bin/ctlstat/ctlstat.c +++ b/usr.bin/ctlstat/ctlstat.c @@ -416,9 +416,10 @@ ctlstat_standard(struct ctlstat_context *ctx) { if (F_CPU(ctx) && (getcpu(&ctx->cur_cpu) != 0)) errx(1, "error returned from getcpu()"); - cur_secs = ctx->cur_time.tv_sec + (ctx->cur_time.tv_nsec / 1000000000); + cur_secs = ctx->cur_time.tv_sec + + ((long double)ctx->cur_time.tv_nsec / 1000000000); prev_secs = ctx->prev_time.tv_sec + - (ctx->prev_time.tv_nsec / 1000000000); + ((long double)ctx->prev_time.tv_nsec / 1000000000); etime = cur_secs - prev_secs; |
