diff options
Diffstat (limited to 'src/aig/ssw/sswRarity2.c')
-rw-r--r-- | src/aig/ssw/sswRarity2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/aig/ssw/sswRarity2.c b/src/aig/ssw/sswRarity2.c index 3026cf6b..d8cb9c16 100644 --- a/src/aig/ssw/sswRarity2.c +++ b/src/aig/ssw/sswRarity2.c @@ -309,6 +309,7 @@ int Ssw_RarSimulate2( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, i int fMiter = 1; Ssw_RarMan_t * p; int r, clk, clkTotal = clock(); + int nTimeToStop = time(NULL) + TimeOut; int RetValue = -1; assert( Aig_ManRegNum(pAig) > 0 ); assert( Aig_ManConstrNum(pAig) == 0 ); @@ -351,7 +352,7 @@ int Ssw_RarSimulate2( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, i printf( "." ); } // check timeout - if ( TimeOut && ((float)TimeOut <= (float)(clock()-clkTotal)/(float)(CLOCKS_PER_SEC)) ) + if ( TimeOut && time(NULL) > nTimeToStop ) { if ( fVerbose ) printf( "\n" ); printf( "Reached timeout (%d seconds).\n", TimeOut ); @@ -386,6 +387,7 @@ int Ssw_RarSignalFilter2( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSiz int fMiter = 0; Ssw_RarMan_t * p; int r, i, k, clkTotal = clock(); + int nTimeToStop = time(NULL) + TimeOut; int RetValue = -1; assert( Aig_ManRegNum(pAig) > 0 ); assert( Aig_ManConstrNum(pAig) == 0 ); @@ -458,7 +460,7 @@ int Ssw_RarSignalFilter2( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSiz Ssw_RarTransferPatterns( p, p->vInits ); Ssw_SmlInitializeSpecial( p->pSml, p->vInits ); // check timeout - if ( TimeOut && ((float)TimeOut <= (float)(clock()-clkTotal)/(float)(CLOCKS_PER_SEC)) ) + if ( TimeOut && time(NULL) > nTimeToStop ) { if ( fVerbose ) printf( "\n" ); printf( "Reached timeout (%d seconds).\n", TimeOut ); |