From 3aab7245738a69f1dd4d898493d5dabf6596ea61 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 7 Jul 2012 17:46:54 -0700 Subject: Fixing time primtouts throughout the code. --- src/aig/saig/saigGlaPba.c | 44 +++++++------------------------------------- 1 file changed, 7 insertions(+), 37 deletions(-) (limited to 'src/aig/saig/saigGlaPba.c') diff --git a/src/aig/saig/saigGlaPba.c b/src/aig/saig/saigGlaPba.c index 6f461995..e039ed75 100644 --- a/src/aig/saig/saigGlaPba.c +++ b/src/aig/saig/saigGlaPba.c @@ -48,46 +48,15 @@ struct Aig_Gla2Man_t_ // SAT solver sat_solver * pSat; // statistics - int timePre; - int timeSat; - int timeTotal; + clock_t timePre; + clock_t timeSat; + clock_t timeTotal; }; //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// -#define ABC_CPS 1000 - -/**Function************************************************************* - - Synopsis [Procedure returns miliseconds elapsed since the last reset.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -int Abc_Clock( int Timer, int fReset ) -{ - static int Time[16], Clock[16]; - int Clock2, Diff; - assert( Timer >= 0 && Timer < 16 ); - if ( fReset ) - { - Time[Timer] = time(NULL); - Clock[Timer] = clock(); - return 0; - } - Clock2 = clock(); - if ( Clock2 > Clock[Timer] ) - Diff = (Clock2 - Clock[Timer]) % CLOCKS_PER_SEC; - else - Diff = CLOCKS_PER_SEC - (Clock[Timer] - Clock2) % CLOCKS_PER_SEC; - return (time(NULL) - Time[Timer]) * ABC_CPS + (Diff * ABC_CPS) / CLOCKS_PER_SEC; -} /**Function************************************************************* @@ -432,7 +401,8 @@ Vec_Int_t * Saig_AbsSolverUnsatCore( sat_solver * pSat, int nConfMax, int fVerbo Vec_Int_t * vCore; void * pSatCnf; Intp_Man_t * pManProof; - int RetValue, clk = clock(); + int RetValue; + clock_t clk = clock(); if ( piRetValue ) *piRetValue = -1; // solve the problem @@ -556,8 +526,8 @@ Vec_Int_t * Aig_Gla2ManPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, in { Aig_Gla2Man_t * p; Vec_Int_t * vCore, * vResult; - int nTimeToStop = time(NULL) + TimeLimit; - int clk, clk2 = clock(); + clock_t nTimeToStop = TimeLimit ? TimeLimit * CLOCKS_PER_SEC + clock(): 0; + clock_t clk, clk2 = clock(); assert( Saig_ManPoNum(pAig) == 1 ); if ( fVerbose ) -- cgit v1.2.3