#include #include #include using namespace std; int main() { int i; boost::posix_time::ptime startTime, endTime; boost::posix_time::time_duration totalTime; startTime = boost::posix_time::microsec_clock::local_time(); for(i=0;i<1000000;i++) { cos(i); } endTime = boost::posix_time::microsec_clock::local_time(); cout << "Start time " << startTime << endl; cout << "End Time " << endTime << endl; totalTime = endTime - startTime; cout << "Total Time " << totalTime << endl; cout << "Total Seconds " << totalTime.seconds() << endl; cout << "Total milli Seconds " << totalTime.total_milliseconds() << endl; cout << "Total u Seconds " << totalTime.total_microseconds() << endl; return 0; }