Boost::Timer problem
Hello,
Using gcc on ubuntu, can anyone tell my why this simple code:
/////////////////////////////////////////////////
#include <iostream>
using namespace std;
#include "boost/timer.hpp"
#include
Hi, boost::timer::elapsed() return a time in second. If you wait only 10 ms second you'll not see anything. Try with sleep(10000)... Cheers ~Benoît
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Benoît Dagon Sent: 11 December 2007 16:25 To: boost-users@lists.boost.org Subject: Re: [Boost-users] Boost::Timer problem
Hi,
boost::timer::elapsed() return a time in second. If you wait only 10 ms second you'll not see anything. Try with sleep(10000)...
Cheers ~Benoît
Isn't posix sleep a wait in seconds? usleep is sometimes available as the microseconds function I believe. James This message (including any attachments) contains confidential and/or proprietary information intended only for the addressee. Any unauthorized disclosure, copying, distribution or reliance on the contents of this information is strictly prohibited and may constitute a violation of law. If you are not the intended recipient, please notify the sender immediately by responding to this e-mail, and delete the message from your system. If you have any questions about this e-mail please notify the sender immediately.
Yes, sleep is in seconds. I can confirm that through direct experimentation :) Another forum helped and suggested I use gettimeofday. This works great, but doesn't shed any light on the zeros provided by boost::timer! Linux user #458601 - http://counter.li.org. Hughes, James wrote:
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Benoît Dagon Sent: 11 December 2007 16:25 To: boost-users@lists.boost.org Subject: Re: [Boost-users] Boost::Timer problem
Hi,
boost::timer::elapsed() return a time in second. If you wait only 10 ms second you'll not see anything. Try with sleep(10000)...
Cheers ~Benoît
Isn't posix sleep a wait in seconds? usleep is sometimes available as the microseconds function I believe.
James
This message (including any attachments) contains confidential and/or proprietary information intended only for the addressee. Any unauthorized disclosure, copying, distribution or reliance on the contents of this information is strictly prohibited and may constitute a violation of law. If you are not the intended recipient, please notify the sender immediately by responding to this e-mail, and delete the message from your system. If you have any questions about this e-mail please notify the sender immediately. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Tue, 11 Dec 2007 19:37:56 +0100, Simon Pickles
Yes, sleep is in seconds. I can confirm that through direct experimentation :)
Another forum helped and suggested I use gettimeofday. This works great, but doesn't shed any light on the zeros provided by boost::timer!
Linux user #458601 - http://counter.li.org.
Hughes, James wrote:
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Benoît Dagon Sent: 11 December 2007 16:25 To: boost-users@lists.boost.org Subject: Re: [Boost-users] Boost::Timer problem
Hi,
boost::timer::elapsed() return a time in second. If you wait only 10 ms second you'll not see anything. Try with sleep(10000)...
Cheers ~Benoît
Isn't posix sleep a wait in seconds? usleep is sometimes available as the microseconds function I believe.
James
-- Jonas Hansson
participants (4)
-
Benoît Dagon
-
Hughes, James
-
Jonas Hansson
-
Simon Pickles