Boost logo

Boost Users :

Subject: [Boost-users] boost timer with sleep
From: Andre Paim Lemos (andrepaim_at_[hidden])
Date: 2008-11-10 09:42:04

The following code:

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

int main()

  boost::timer t;

  std::cout << t.elapsed() << std::endl;
  std::cout << t.elapsed() << std::endl;


Returns (compiled with gcc 4.2.4 on Ubuntu Linux 8.04 using boost 1.36):

andre_at_andre-desktop:~/test$ ./timer_test

Is this result expected? Why?
There is another timer implementation that works with sleep?

Andre Paim Lemos

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at