COIN-OR::LEMON - Graph Library

Changeset 482:879c55700cd4 in lemon-1.2 for lemon/time_measure.h


Ignore:
Timestamp:
02/16/09 16:03:32 (11 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
483:3f0ddf255524, 487:afd134142111, 515:b9b3473327e3
Phase:
public
Message:

Wrap around the usages of windows.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/time_measure.h

    r481 r482  
    2525
    2626#ifdef WIN32
    27 #ifndef WIN32_LEAN_AND_MEAN
    28 #define WIN32_LEAN_AND_MEAN
    29 #endif
    30 #ifndef NOMINMAX
    31 #define NOMINMAX
    32 #endif
    33 #include <windows.h>
    34 #include <cmath>
     27#include <lemon/bits/windows.h>
    3528#else
    3629#include <unistd.h>
     
    9386      cstime=ts.tms_cstime/tck;
    9487#else
    95       static const double ch = 4294967296.0e-7;
    96       static const double cl = 1.0e-7;
    97 
    98       FILETIME system;
    99       GetSystemTimeAsFileTime(&system);
    100       rtime = ch * system.dwHighDateTime + cl * system.dwLowDateTime;
    101 
    102       FILETIME create, exit, kernel, user;
    103       if (GetProcessTimes(GetCurrentProcess(),&create, &exit, &kernel, &user)) {
    104         utime = ch * user.dwHighDateTime + cl * user.dwLowDateTime;
    105         stime = ch * kernel.dwHighDateTime + cl * kernel.dwLowDateTime;
    106         cutime = 0;
    107         cstime = 0;
    108       } else {
    109         rtime = 0;
    110         utime = 0;
    111         stime = 0;
    112         cutime = 0;
    113         cstime = 0;
    114       }
     88      bits::getWinProcTimes(rtime, utime, stime, cutime, cstime);
    11589#endif
    11690    }
Note: See TracChangeset for help on using the changeset viewer.