mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 02:45:51 +00:00
working on duality
This commit is contained in:
parent
e939dd2bc5
commit
389c2018df
7 changed files with 29 additions and 89 deletions
|
@ -25,82 +25,7 @@ Revision History:
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
// include "Windows.h"
|
||||
|
||||
|
||||
#if 0
|
||||
typedef __int64 clock_t;
|
||||
|
||||
static clock_t current_time(){
|
||||
LARGE_INTEGER lpPerformanceCount;
|
||||
lpPerformanceCount.QuadPart = 0;
|
||||
QueryPerformanceCounter(&lpPerformanceCount);
|
||||
return lpPerformanceCount.QuadPart;
|
||||
}
|
||||
|
||||
static void output_time(std::ostream &os, clock_t time){
|
||||
LARGE_INTEGER lpFrequency;
|
||||
lpFrequency.QuadPart = 1;
|
||||
QueryPerformanceFrequency(&lpFrequency);
|
||||
os << ((double)time)/lpFrequency.QuadPart;
|
||||
}
|
||||
#else
|
||||
|
||||
typedef double clock_t;
|
||||
|
||||
static clock_t current_time(){
|
||||
FILETIME lpCreationTime;
|
||||
FILETIME lpExitTime;
|
||||
FILETIME lpKernelTime;
|
||||
FILETIME lpUserTime;
|
||||
|
||||
GetProcessTimes( GetCurrentProcess(),
|
||||
&lpCreationTime, &lpExitTime, &lpKernelTime, &lpUserTime );
|
||||
|
||||
|
||||
double usr_time = ((double) lpUserTime.dwLowDateTime)/10000000. +
|
||||
((double) lpUserTime.dwHighDateTime)/(10000000. * pow(2.0,32.0));
|
||||
return usr_time;
|
||||
}
|
||||
|
||||
static void output_time(std::ostream &os, clock_t time){
|
||||
os << time;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <sys/times.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
static clock_t current_time(){
|
||||
#if 0
|
||||
struct tms buf;
|
||||
times(&buf);
|
||||
return buf.tms_utime;
|
||||
#else
|
||||
struct rusage r;
|
||||
getrusage(RUSAGE_SELF, &r);
|
||||
return 1000 * r.ru_utime.tv_sec + r.ru_utime.tv_usec / 1000;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void output_time(std::ostream &os, clock_t time){
|
||||
#if 0
|
||||
os << ((double)time)/sysconf(_SC_CLK_TCK);
|
||||
#else
|
||||
os << ((double)time)/1000;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "duality_wrapper.h"
|
||||
|
||||
namespace Duality {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue