QUDA v0.4.0
A library for QCD on GPUs
|
00001 #include <stdlib.h> 00002 #include <sys/time.h> 00003 00004 #include <util_quda.h> 00005 00006 static struct timeval startTime; 00007 00008 void stopwatchStart() { 00009 gettimeofday(&startTime, NULL); 00010 } 00011 00012 double stopwatchReadSeconds() { 00013 struct timeval endTime; 00014 gettimeofday(&endTime, NULL); 00015 00016 long ds = endTime.tv_sec - startTime.tv_sec; 00017 long dus = endTime.tv_usec - startTime.tv_usec; 00018 return ds + 0.000001*dus; 00019 }