R
roberts.noah
Ok, so I am trying to establish how boost.timer works and I try a few
things and afaict it doesn't. So I open the header to see why and run
some tests to establish what is going on and it all boils down to the
clock() function. Here is the code:
#include <iostream>
#include <cstdlib>
int main(void)
{
boost::timer tmr;
sleep(15);
std::cout << std::clock() << std::endl;
return 0;
}
That program always outputs "0". Documentation on clock() says that it
should return clock ticks since program started, which with the 15
second sleep that should be plenty. I don't understand.
things and afaict it doesn't. So I open the header to see why and run
some tests to establish what is going on and it all boils down to the
clock() function. Here is the code:
#include <iostream>
#include <cstdlib>
int main(void)
{
boost::timer tmr;
sleep(15);
std::cout << std::clock() << std::endl;
return 0;
}
That program always outputs "0". Documentation on clock() says that it
should return clock ticks since program started, which with the 15
second sleep that should be plenty. I don't understand.