diff options
Diffstat (limited to 'rasmgr/rasmgr_config.cc')
-rw-r--r-- | rasmgr/rasmgr_config.cc | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/rasmgr/rasmgr_config.cc b/rasmgr/rasmgr_config.cc index 4919975..24d1130 100644 --- a/rasmgr/rasmgr_config.cc +++ b/rasmgr/rasmgr_config.cc @@ -508,57 +508,3 @@ void Configuration::printStatus() return; } -//**************************************************************************************************************** - -// FIXME: this needs refinement -- PB 2003-jun-09 -BenchmarkTimer::BenchmarkTimer(const char *text) -{ - this->text = (char*)text; - time_t now = time(NULL); - char *n = ctime(&now); - n[strlen(n)-1] = '\0'; // delete trailing newline char - // cout << "--- rasmgr timer start for \'" << text << "\' at " << n << "." << endl; - gettimeofday(&start,NULL); -} - -BenchmarkTimer::~BenchmarkTimer() -{ -} - -void BenchmarkTimer::result() -{ - timeval result; - gettimeofday(&end,NULL); - int r=timeval_subtract(&result,&end,&start); - time_t now = time(NULL); - char *n = ctime(&now); - n[strlen(n)-1] = '\0'; // delete trailing newline char - VLOG << "rasmgr timer stop for \'" << text << "\' at " << n << ": " << result.tv_sec << '.' << std::setw(3) << std::setfill('0') << result.tv_usec << " seconds elapsed." << endl; -} - -int BenchmarkTimer::timeval_subtract(timeval *result,timeval *x,timeval *y) -{ -#define ONE_MILLION 1000000 - /* Perform the carry for the later subtraction by updating Y. */ - if (x->tv_usec < y->tv_usec) - { - int nsec = (y->tv_usec - x->tv_usec) / ONE_MILLION + 1; - y->tv_usec -= ONE_MILLION * nsec; - y->tv_sec += nsec; - } - if (x->tv_usec - y->tv_usec > ONE_MILLION) - { - int nsec = (x->tv_usec - y->tv_usec) / ONE_MILLION; - y->tv_usec += ONE_MILLION * nsec; - y->tv_sec -= nsec; - } - - /* Compute the time remaining to wait. - `tv_usec' is certainly positive. */ - result->tv_sec = x->tv_sec - y->tv_sec; - result->tv_usec = x->tv_usec - y->tv_usec; - - /* Return 1 if result is negative. */ - return x->tv_sec < y->tv_sec; -} - |