[chrono] v0.3.1 Support for wide characters

Hi, this new version includes: * Added support for wide characters on formatters. * Added chrono.hpp and stopwatches.hpp header files at the boost level. * Update of the doc taking care of preceding comments. Comments are welcome :) Best, Vicente ----- Original Message ----- From: "vicente.botet" <vicente.botet@wanadoo.fr> To: <boost@lists.boost.org>; <boost-users@lists.boost.org> Sent: Sunday, January 17, 2010 9:14 PM Subject: [chrono] v0.3 New Stopwatch Feature Hi, I'm pleased to announce the new version of the Boost.Chrono library. The implementaton is quite stable; the new interface could suffer of some modifications, renaming, ... as far as you submit some proposals. I would request a formal review soon and I will need a review manager. I know that review managers are hard to find, so if you are interested in the library, please the Review Wizards. The library can be downloaded from http://www.boostpro.com/vault/index.php?action=downloadfile&filename=chrono.zip&directory=System& and the documentation is online on the sandbox http://svn.boost.org/svn/boost/sandbox/chrono/libs/chrono/doc/html/index.htm.... I've tested it with gcc and MSVC. Previoous version of the library have been testted on Mac, but I'm not able to test this platform. Could someone check if there are some regressions on Mac? New Features: * Process cpu clocks * Independent process cpu clocks for real, user, system process CPU time * Global process cpu clock for real, user, system process CPU time * Stopwatch concept measuring elapsed time between different points in time associated to the operations start, stop, suspend and resume. * stopwatch is a model Stopwatch measuring the elapsed time between the start and the stop operations. * stopwatch_accumulator is a model Stopwatch allowing to accumulate several time samples and give the average, ... * Scoped helper classes allowing to pairwise start/stop operations, suspend/resume and resume/suspend a Stopwatch. * Stopwatch Formatter concept * stopwatch formatter "%ds\n" * stopwatch accumulator formatter "%c times, sum%ss, min%ms, max%Ms, mean%as\n" * time formatter "real %rs, cpu %cs (%p%), user %us, system %ss\n" * digital_time decomposition class separating days, hours,minutes,seconds, nanoseconds from any duration class (looking for a better name) * digital_time formatter "%d days(s) %h:%m:%s.%n\n" * stopwatch_reporter is a convenient generic class reporting elapsed time for the Stopwatch concept. * stopclock<Clock> shortcut stopwatch_reporter<stopwatch<Clcok>> * typeof registration for classes duration and time_point Depreceated Features: * The classes process_times, process_clock, process_timer, timer and run_timer are now deprecated as the preceding additions are more generic. However for backward compatibility they are preserved until inclusion of the library in Boost. Next follows the equivalences: timer<> ~ stopwatch<> process_timer ~ stopwatch<process_cpu_clock> run_timer ~ stopclock<> Bug Fixes * Try to correct warning C4251: 'boost::chrono::run_timer::m_format' : class 'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be used by clients of class 'boost::chrono::run_timer', by don't including inlines functions using the std::string m_format. For people that doesn't know it yet, Boost.Chrono library provides: * The C++0x Standard Library's common_type. * The C++0x Standard Library's compile-time rational arithmetic. * The C++0x Standard Library's time utilities, including: * Class template duration * Class template time_point * Clocks: * system_clock * monotonic_clock * high_resolution_clock * typeof registration for classes duration and time_point * Process clocks: * process_real_CPU_clocks, capturing real-CPU times. * process_user_CPU_clocks, capturing user-CPU times. * process_system_CPU_clocks, capturing system-CPU times. * process_cpu_clock, tuple-like class capturing at once real, user-CPU, and system-CPU times. * Stopwatches: * stopwatch, capturing elapsed Clock times. * stopwatch_accumulator, capturing cummulated elapsed Clock times. * scoped helper classes allowing to pairwise start/stop operations, suspend/resume and resume/suspend a Stopwatch. * Stopclocks or Stopwatch reporters: * stopwatch_reporter, convenient reporting of models of Stopwatch results. * stopclock<Clock> shortcut of stopwatch_reporter<stopwatch<Clock>> Best regards, _____________________ Vicente Juan Botet Escribá

I kinda missed the last shot of comments but I have a question. You speak about:
* stopwatch_accumulator, capturing cummulated elapsed Clock times.
Do they use boost::accumulators and if yes, can we give them special stats to compute in addition to min,max,mean ? Other questions: is there plan for a cycle counter absed watch using the various compiler/os specific stuff like rdtsc et al ? -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35

Hi Joel, ----- Original Message ----- From: "joel falcou" <joel.falcou@lri.fr> To: <boost@lists.boost.org> Sent: Wednesday, January 20, 2010 11:05 PM Subject: Re: [boost] [chrono] v0.3.1 Support for wide characters
I kinda missed the last shot of comments but I have a question. You speak about:
* stopwatch_accumulator, capturing cummulated elapsed Clock times.
Do they use boost::accumulators and if yes, can we give them special stats to compute in addition to min,max,mean ?
Yes, it uses boost::accumulators so you can give it the Accumulator you want and of course define the associated formatter. I have not included an example on the documentation, but you can have an idea by looking on how stopwatch_accumulator is done and how the default accumulators is given. Here follow an example not yet compiled: #include <boost/chrono/stopwatches.hpp> #include <cmath> using namespace boost::chrono; using namespace boost::accumulators; typedef stopwatch_accumulator<process_real_cpu_clock, accumulator_set<process_real_cpu_clock::rep, features< tag::count, tag::sum, tag::min, tag::max, tag::mean > >, my_stopwatch_accumulator_formatter
::reporter my_stopwatch_accumulator_reporter;
// where my_stopwatch_accumulator_formatter will follow the same schema that stopwatch_accumulator_formatter.hpp int f1(long j) { static my_stopwatch_accumulator_reporter acc(BOOST_CHRONO_ACCUMULATOR_FUNCTION_FORMAT); my_stopwatch_accumulator_reporter::scoped_run _(acc); for ( long i = 0; i < j; ++i ) std::sqrt( 123.456L ); // burn some time return 0; } int main() { f1(100000); f1(200000); f1(300000); return 0; }
Other questions: is there plan for a cycle counter absed watch using the various compiler/os specific stuff like rdtsc et al ?
I'm sorry, but I suspect that I'm not competent in this domain. A clock don't require too much things. Thus for some one with a good knowledge of what is "a cycle counter absed watch using the various compiler/os specific stuff like rdtsc et al" it should be quite easy to implement a clock based on this counting. Here follows an extract from the documentation: A clock represents a bundle consisting of a native duration, a native time_point, and a function now() to get the current time_point. A clock must meet the requirements in the following Table. In this table C1 and C2 denote clock types. t1 and t2 are values returned from C1::now() where the call returning t1 happens before the call returning t2 and both of these calls happen before C1::time_point::max(). Table 1. Clock Requirements expression return type operational semantics C1::rep An arithmetic type or class emulating an arithmetic type. The representation type of the native duration and time_point. C1::period ratio The tick period of the clock in seconds. C1::duration chrono::duration<C1::rep, C1::period> The native duration type of the clock. C1::time_point chrono::time_point<C1> or chrono::time_point<C2, C1::duration> The native time_point type of the clock. Different clocks are permitted to share a time_point definition if it is valid to compare their time_points by comparing their respective durations. C1 and C2 must refer to the same epoch. C1::is_monotonic const bool true if t1 <= t2 is always true, else false. Note: A clock that can be adjusted backwards is not monotonic C1::now() C1::time_point Returns a time_point representing the current point in time. You could find a better formmating on the documentation. As you can see, you need just to implement a static function returning this counter. The rest is pure formalism. Hoping this answer your questions. Vicente

vicente.botet wrote:
A clock represents a bundle consisting of a native duration, a native time_point, and a function now() to get the current time_point. A clock must meet the requirements in the following Table.
In this table C1 and C2 denote clock types. t1 and t2 are values returned from C1::now() where the call returning t1 happens before the call returning t2 and both of these calls happen before C1::time_point::max().
Table 1. Clock Requirements expression return type operational semantics C1::rep An arithmetic type or class emulating an arithmetic type. The representation type of the native duration and time_point. C1::period ratio The tick period of the clock in seconds. C1::duration chrono::duration<C1::rep, C1::period> The native duration type of the clock. C1::time_point chrono::time_point<C1> or chrono::time_point<C2, C1::duration> The native time_point type of the clock. Different clocks are permitted to share a time_point definition if it is valid to compare their time_points by comparing their respective durations. C1 and C2 must refer to the same epoch. C1::is_monotonic const bool true if t1 <= t2 is always true, else false. Note: A clock that can be adjusted backwards is not monotonic C1::now() C1::time_point Returns a time_point representing the current point in time.
You could find a better formmating on the documentation.
As you can see, you need just to implement a static function returning this counter. The rest is pure formalism.
Hoping this answer your questions.
Oh it does, it's even better this way :)

Est-ce que ca convient ? Jean-Thierry Lapresté is a french professor at the Blaise Pascal University of Clermont-Ferrand. He was born in Paris in 1949. He has a mathematical formation and worked 10 years in the field of Banach spaces theory, then he turned (up to now) to artificial vision. Not speaking of proper vision works related with tracking and in image geometry, he is working with J. Falcou to provide an efficient and extensible matrix library in C++ usable by end users (with no esoteric knowledge of programming techniques) but providing seamless access at the power of the new hardware architectures nowadays currently on the shelf. JT

Hi Vicente, On Wed, Jan 20, 2010 at 5:02 PM, vicente.botet <vicente.botet@wanadoo.fr> wrote:
Hi,
this new version includes: * Added support for wide characters on formatters. * Added chrono.hpp and stopwatches.hpp header files at the boost level. * Update of the doc taking care of preceding comments.
Comments are welcome :)
This is funny. You have added support for MSVC 5.0? I highly doubt that. ;-) You probably mean MSVC 8.0. Regards, Christian

Hi, ----- Original Message ----- From: "Christian Henning" <chhenning@gmail.com> To: <boost@lists.boost.org> Sent: Wednesday, January 20, 2010 11:22 PM Subject: Re: [boost] [chrono] v0.3.1 Support for wide characters
Hi Vicente,
On Wed, Jan 20, 2010 at 5:02 PM, vicente.botet <vicente.botet@wanadoo.fr> wrote:
Hi,
this new version includes: * Added support for wide characters on formatters. * Added chrono.hpp and stopwatches.hpp header files at the boost level. * Update of the doc taking care of preceding comments.
Comments are welcome :)
This is funny. You have added support for MSVC 5.0? I highly doubt that. ;-) You probably mean MSVC 8.0.
I have taken this from your post: http://old.nabble.com/-chrono--v0.3--New-Stopwatch-Feature-tt27202338.html "Hi Vicente, thanks for your reply. I have successfully run compilation and tests with VS2005. You might wanna add that compiler to your doc." I will update the doc if you meant VS2008. Vicente

vicente.botet wrote:
Hi, ----- Original Message ----- From: "Christian Henning" <chhenning@gmail.com> To: <boost@lists.boost.org> Sent: Wednesday, January 20, 2010 11:22 PM Subject: Re: [boost] [chrono] v0.3.1 Support for wide characters
Hi Vicente,
[snip]
Comments are welcome :)
This is funny. You have added support for MSVC 5.0? I highly doubt that. ;-) You probably mean MSVC 8.0.
I have taken this from your post:
http://old.nabble.com/-chrono--v0.3--New-Stopwatch-Feature-tt27202338.html "Hi Vicente, thanks for your reply. I have successfully run compilation and tests with VS2005. You might wanna add that compiler to your doc."
I will update the doc if you meant VS2008.
MSVC8 = VS2005 MSVC9 = VS2008 HTH / Johan

vicente.botet wrote:
Hi, ----- Original Message ----- From: "Christian Henning" <chhenning@gmail.com> To: <boost@lists.boost.org> Sent: Wednesday, January 20, 2010 11:22 PM Subject: Re: [boost] [chrono] v0.3.1 Support for wide characters
This is funny. You have added support for MSVC 5.0? I highly doubt that. ;-) You probably mean MSVC 8.0.
I have taken this from your post: http://old.nabble.com/-chrono--v0.3--New-Stopwatch-Feature-tt27202338.html "Hi Vicente, thanks for your reply. I have successfully run compilation and tests with VS2005. You might wanna add that compiler to your doc."
I will update the doc if you meant VS2008.
Vicente
Hi Vicente - VC8 is Visual Studio (VS) 2005. It is often a source of confusion. michael -- ---------------------------------- Michael Caisse Object Modeling Designs www.objectmodelingdesigns.com
participants (7)
-
Christian Henning
-
joel falcou
-
Joel Falcou
-
Johan Nilsson
-
jtl
-
Michael Caisse
-
vicente.botet