diff options
Diffstat (limited to 'src/base/cmd')
-rw-r--r-- | src/base/cmd/cmd.c | 8 | ||||
-rw-r--r-- | src/base/cmd/cmdUtils.c | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/base/cmd/cmd.c b/src/base/cmd/cmd.c index 4cac6190..fd57f430 100644 --- a/src/base/cmd/cmd.c +++ b/src/base/cmd/cmd.c @@ -168,17 +168,17 @@ int CmdCommandTime( Abc_Frame_t * pAbc, int argc, char **argv ) } pAbc->TimeTotal += pAbc->TimeCommand; - fprintf( pAbc->Out, "elapse: %3.2f seconds, total: %3.2f seconds\n", - (float)(1.0 * pAbc->TimeCommand / CLOCKS_PER_SEC), (float)(1.0 * pAbc->TimeTotal / CLOCKS_PER_SEC) ); + fprintf( pAbc->Out, "elapse: %3.2f seconds, total: %3.2f seconds\n", + pAbc->TimeCommand, pAbc->TimeTotal ); /* { FILE * pTable; pTable = fopen( "runtimes.txt", "a+" ); - fprintf( pTable, "%4.2f\n", (float)pAbc->TimeCommand / CLOCKS_PER_SEC ); + fprintf( pTable, "%4.2f\n", pAbc->TimeCommand ); fclose( pTable ); } */ - pAbc->TimeCommand = 0; + pAbc->TimeCommand = 0.0; return 0; usage: diff --git a/src/base/cmd/cmdUtils.c b/src/base/cmd/cmdUtils.c index 47e54bb3..6b4bdcbe 100644 --- a/src/base/cmd/cmdUtils.c +++ b/src/base/cmd/cmdUtils.c @@ -92,7 +92,7 @@ int CmdCommandDispatch( Abc_Frame_t * pAbc, int argc, char **argv ) Abc_Command * pCommand; char * value; int fError; - int clk; + double clk; if ( argc == 0 ) return 0; @@ -121,10 +121,10 @@ int CmdCommandDispatch( Abc_Frame_t * pAbc, int argc, char **argv ) } // execute the command - clk = Extra_CpuTime(); + clk = Extra_CpuTimeDouble(); pFunc = (int (*)(Abc_Frame_t *, int, char **))pCommand->pFunc; fError = (*pFunc)( pAbc, argc, argv ); - pAbc->TimeCommand += (Extra_CpuTime() - clk); + pAbc->TimeCommand += Extra_CpuTimeDouble() - clk; // automatic execution of arbitrary command after each command // usually this is a passive command ... |