Hi again with a boost question: I need to calculate the time spent in my function in my boost thread: here is the code:
boost::posix_time::microseconds tes( 12 );
int i = 0;
while( true )
{
boost::posix_time::ptime start = boost::posix_time::microsec_clock::local_time( );
myFunction( );
boost::this_thread::sleep( tes );
boost::posix_time::ptime end = boost::posix_time::microsec_clock::local_time( );
boost::posix_time::time_duration elapsed = end - start;
}
so I tried many times but the elapsed time_duration is always 0, I've added to test the sleep function of 12 microsecs, so in the best ways I will have 12 microsec elapsed but is still 0.. I need to tell to the thread to update the timer after the time read??
thanks