Boost logo

Boost Users :

From: Yunior Peralta González (yperaltag_at_[hidden])
Date: 2007-05-09 09:32:49


I don't know why but the boost::timer does work well.
Please, look at the following example bellow and if any idea let me know.

#include <boost/timer.hpp>
#include <iostream>
#include <unistd.h>

int main()
{
    boost::timer timer;

    sleep(1);
/* block until one second has elapsed */
    std::cout << timer.elapsed() << std::endl; /* show the elapsed
time (one second expected) */

    return 0;
}

Though I am not sure I thing the timer just have in mind the time the
processor was busy and not the time the application was running.
Has the boost library any standard sleep(), I have heard boost::asio has a
very good one.

Thanks in advance.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net