diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-02-23 08:24:59 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-02-23 08:24:59 +0000 |
commit | b9bdac02514b305f7fb25d810054c99fa332f4a0 (patch) | |
tree | f0ea3932872bcb476c00fa65a0790c40d7a0bea3 /src/helper/time_support.c | |
parent | c1eb1a369073742ce962dcaba73c73b0cdddcc93 (diff) |
- added time command
- changed syntax of time measurements to seconds, e.g. 1.2324s
git-svn-id: svn://svn.berlios.de/openocd/trunk@321 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper/time_support.c')
-rw-r--r-- | src/helper/time_support.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/helper/time_support.c b/src/helper/time_support.c index de48fce8..f772d2f4 100644 --- a/src/helper/time_support.c +++ b/src/helper/time_support.c @@ -102,8 +102,11 @@ int duration_stop_measure(duration_t *duration, char **text) if (text) { - *text = malloc(16); - snprintf(*text, 16, "%lis %lius", duration->duration.tv_sec, duration->duration.tv_usec); + float t; + t=duration->duration.tv_sec; + t+=(float)duration->duration.tv_usec/1000000.0; + *text = malloc(100); + snprintf(*text, 100, "%fs", t); } return ERROR_OK; |