|
Boost : |
From: Beman Dawes (beman_at_[hidden])
Date: 1999-06-30 08:09:40
I would like to get some feedback on two timer and one progress
reporting class before going to the trouble of documenting them. See
http://www.boost.org/libs/timer/
One concern is that the message written to cout by the job_timer
class is not internationalized. While such a relatively minor class
doesn't justify a whole lot of internationalization machinery, is it
at least possible to do something better than the following?
[elapsed() returns a double]
using std::cout;
using std::ios_base;
namespace boost {
job_timer::~job_timer() {
ios_base::fmtflags old_flags = cout.setf( ios_base::fixed,
ios_base::floatfield );
std::streamsize old_prec = cout.precision( 2 );
cout << elapsed() << " seconds\n" << std::endl;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cout.flags( old_flags );
cout.precision( old_prec );
} // ~job_timer
} // namespace boost
Comments appreciated!
--Beman
------------------------------------------------------------------------
eGroups.com home: http://www.egroups.com/group/boost
http://www.egroups.com - Simplifying group communications
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk