next up previous contents
Next: barrier.h Up: Code for the Simulation Previous: util.C   Contents

timer.C

#include <iostream>
#include <sys/time.h>

using namespace std;

double  get_clock() {
   struct timeval tv; int ok;
   ok = gettimeofday(&tv, NULL);
   if (ok<0) { cout << "gettimeofday error" << endl;  }
   return (tv.tv_sec * 1.0 + tv.tv_usec * 1.0E-6);
}


next up previous contents
Next: barrier.h Up: Code for the Simulation Previous: util.C   Contents
Matthew Hayward - Quantum Computing, Shor's Algorithm, and Parallelism GitHub Repository