I am using boost timer in C++ builder 2009 to test the time used in my program.there are the lines:
....................
boost::timer t;
double timeresult;
...................
t.restart();
........... //my program main body
timeresult=t.elapsed();
ShowMessage( " the time consumed by my program is "+FloatToStr(timeresult));
.........................
the program was compiled and linked and worked well.
But I find a problem:
every time the message showed is not the same time interval,
sometimes it is 0.015 and sometimes it is 0.016 and sometimes it is 0.
I do not know how it was happened.
Does it happen due to the multi-process and multi-thread mode by windows?
I do not know how to solve it. My program is quite strict on the time consumed by the computer.
Can any one with kindness help me?
网易邮箱用户购物独享现金返还