X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fhelper%2Ftime_support.c;h=f772d2f4f0b887a588c657f6c48f041f5f79b37f;hp=de48fce842a85769c5285a20c12b8f7f784fe202;hb=b9bdac02514b305f7fb25d810054c99fa332f4a0;hpb=c1eb1a369073742ce962dcaba73c73b0cdddcc93;ds=sidebyside diff --git a/src/helper/time_support.c b/src/helper/time_support.c index de48fce842..f772d2f4f0 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;