Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions extern/bliss-0.73/timer.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <unistd.h>
#include <sys/times.h>
#include <time.h>
#include "timer.hh"

/*
Expand Down Expand Up @@ -32,7 +31,7 @@

namespace bliss_digraphs {

static const double numTicksPerSec = (double)(sysconf(_SC_CLK_TCK));
static const double numTicksPerSec = (double)CLOCKS_PER_SEC;

Timer::Timer()
{
Expand All @@ -41,23 +40,13 @@ Timer::Timer()

void Timer::reset()
{
struct tms clkticks;

// times(&clkticks);
start_time =
((double) clkticks.tms_utime + (double) clkticks.tms_stime) /
numTicksPerSec;
start_time = (double)clock() / numTicksPerSec;
}


double Timer::get_duration()
{
struct tms clkticks;

// times(&clkticks);
double intermediate =
((double) clkticks.tms_utime + (double) clkticks.tms_stime) /
numTicksPerSec;
double intermediate = (double)clock() / numTicksPerSec;
return intermediate - start_time;
}

Expand Down
Loading