Atlas-C++
timer.h
1 #include <time.h>
2 
3 clock_t calc_time0,calc_time1;
4 double calc_time;
5 #define TIME_ON calc_time0=clock();
6 #define TIME_OFF(msg) calc_time1=clock(); \
7  calc_time=(double)(calc_time1-calc_time0)/CLOCKS_PER_SEC; \
8  std::cout<<msg<<": iterations="<<i \
9  <<" CPU Time="<<calc_time \
10  <<" iter/s="<<i/calc_time<<std::endl;
11 

Copyright 2000-2004 the respective authors.

This document can be licensed under the terms of the GNU Free Documentation License or the GNU General Public License and may be freely distributed under the terms given by one of these licenses.