Changeset 674 for branches


Ignore:
Timestamp:
Jul 3, 2007 10:53:32 AM (12 years ago)
Author:
forrest
Message:

timing

Location:
branches/devel/Cbc/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/src/CbcModel.cpp

    r673 r674  
    6363
    6464#include "CoinTime.hpp"
    65 static inline double CoinCpuTimeJustChildren()
    66 {
    67   double cpu_temp;
    68 #if defined(_MSC_VER) || defined(__MSVCRT__)
    69   unsigned int ticksnow;        /* clock_t is same as int */
    70  
    71   ticksnow = (unsigned int)clock();
    72  
    73   cpu_temp = (double)((double)ticksnow/CLOCKS_PER_SEC);
    74 #else
    75   struct rusage usage;
    76 # ifdef ZEROFAULT
    77   usage.ru_utime.tv_sec = 0 ;
    78   usage.ru_utime.tv_usec = 0 ;
    79 # endif
    80   getrusage(RUSAGE_CHILDREN,&usage);
    81   cpu_temp = usage.ru_utime.tv_sec;
    82   cpu_temp += 1.0e-6*((double) usage.ru_utime.tv_usec);
    83 #endif
    84   return cpu_temp;
    85 }
    8665#include "CoinMpsIO.hpp"
    8766
  • branches/devel/Cbc/src/CbcSolver.cpp

    r665 r674  
    44654465                }
    44664466              }
    4467               time2 = CoinCpuTime();
     4467              // adjust time to allow for children on some systems
     4468              time2 = CoinCpuTime() + CoinCpuTimeJustChildren();
    44684469              totalTime += time2-time1;
    44694470              // For best solution
Note: See TracChangeset for help on using the changeset viewer.