- 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
This commit is contained in:
oharboe
2008-02-23 08:24:59 +00:00
parent c1eb1a3690
commit b9bdac0251
2 changed files with 34 additions and 2 deletions

View File

@@ -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;