- 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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user