summaryrefslogtreecommitdiffstats
path: root/src/base/cmd
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-05-27 15:09:23 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-05-27 15:09:23 -0700
commit19c25fd6aab057b2373717f996fe538507c1b1e1 (patch)
tree7aa7cd7609a5de31d11b3455b6388fd9300c8d0f /src/base/cmd
parent94356f0d1fa8e671303299717f631ecf0ca2f17e (diff)
downloadabc-19c25fd6aab057b2373717f996fe538507c1b1e1.tar.gz
abc-19c25fd6aab057b2373717f996fe538507c1b1e1.tar.bz2
abc-19c25fd6aab057b2373717f996fe538507c1b1e1.zip
Adding a wrapper around clock() for more accurate time counting in ABC.
Diffstat (limited to 'src/base/cmd')
-rw-r--r--src/base/cmd/cmdPlugin.c6
-rw-r--r--src/base/cmd/cmdStarter.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/base/cmd/cmdPlugin.c b/src/base/cmd/cmdPlugin.c
index 2aa95e85..37a28e63 100644
--- a/src/base/cmd/cmdPlugin.c
+++ b/src/base/cmd/cmdPlugin.c
@@ -418,7 +418,7 @@ int Cmd_CommandAbcPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv )
FILE * pFile;
Gia_Man_t * pGia;
int i, fd;
- clock_t clk;
+ abctime clk;
int fLeaveFiles;
/*
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
@@ -536,14 +536,14 @@ int Cmd_CommandAbcPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv )
// run the command line
//printf( "Running command line: %s\n", Vec_StrArray(vCommand) );
- clk = clock();
+ clk = Abc_Clock();
if ( Util_SignalSystem( Vec_StrArray(vCommand) ) )
{
Abc_Print( -1, "The following command has returned non-zero exit status:\n" );
Abc_Print( -1, "\"%s\"\n", Vec_StrArray(vCommand) );
return 1;
}
- clk = clock() - clk;
+ clk = Abc_Clock() - clk;
Vec_StrFree( vCommand );
// check if the output file exists
diff --git a/src/base/cmd/cmdStarter.c b/src/base/cmd/cmdStarter.c
index bfdd480c..16810baa 100644
--- a/src/base/cmd/cmdStarter.c
+++ b/src/base/cmd/cmdStarter.c
@@ -111,7 +111,7 @@ void Cmd_RunStarter( char * pFileName, char * pBinary, char * pCommand, int nCor
char * BufferCopy, * Buffer;
int nLines, LineMax, Line, Len;
int i, c, status, Counter;
- clock_t clk = clock();
+ abctime clk = Abc_Clock();
// check the number of cores
if ( nCores < 2 )
@@ -244,7 +244,7 @@ void Cmd_RunStarter( char * pFileName, char * pBinary, char * pCommand, int nCor
// status = pthread_mutex_destroy(&mutex); assert(status == 0);
// mutex = PTHREAD_MUTEX_INITIALIZER;
fprintf( stdout, "Finished processing commands in file \"%s\". ", pFileName );
- Abc_PrintTime( 1, "Total wall time", clock() - clk );
+ Abc_PrintTime( 1, "Total wall time", Abc_Clock() - clk );
fflush( stdout );
}