1#include "RCCE.h" 2#ifdef _OPENMP 3#include "omp.h" 4#endif 5#include "timers.h" 6#define elapsed(n) elapsed[n-1] 7#define start(n) start[n-1] 8 9void timer_clear(int *np){ 10 11 int n = *np; 12 elapsed(n) = 0.0; 13 return; 14} 15 16 17void timer_start(int *np) { 18 19 int n = *np; 20 21 start(n) = RCCE_wtime(); 22 23 return; 24} 25 26void timer_stop(int *np) { 27 28 int n = *np; 29 30 double t, now; 31 now = RCCE_wtime(); 32 t = now - start(n); 33 elapsed(n) = elapsed(n) + t; 34 35 return; 36} 37 38 39double timer_read(int *np) { 40 41 int n = *np; 42 return( elapsed(n)); 43} 44 45