[Lemon-commits] [lemon_svn] alpar: r2349 - hugo/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:51:58 CET 2006
Author: alpar
Date: Wed Nov 16 14:21:57 2005
New Revision: 2349
Modified:
hugo/trunk/lemon/time_measure.h
Log:
The first parameter of runningTimeTest became const.
It is necessary to enable to pass of temporary objects.
Modified: hugo/trunk/lemon/time_measure.h
==============================================================================
--- hugo/trunk/lemon/time_measure.h (original)
+++ hugo/trunk/lemon/time_measure.h Wed Nov 16 14:21:57 2005
@@ -219,7 +219,7 @@
///\endcode
///
///The \ref Timer can also be \ref stop() "stopped" and
- ///\ref start() "started" again, so it is easy to compute collected
+ ///\ref start() "started" again, so it is possible to compute collected
///running times.
///
///\warning Depending on the operation system and its actual configuration
@@ -371,14 +371,14 @@
///\return The average running time of \c f.
template<class F>
- TimeStamp runningTimeTest(F &f,double min_time=10,int *num = NULL,
+ TimeStamp runningTimeTest(const F &f,double min_time=10,int *num = NULL,
TimeStamp *full_time=NULL)
{
Timer t;
TimeStamp full;
int total=0;
for(int tn=1;tn < 1<<24; tn*=2) {
- for(;total<tn;total++) f();
+ for(;total<tn;total++) const_cast<F &>(f)();
full=t;
if(full.realTime()>min_time) {
if(num) *num=total;
More information about the Lemon-commits
mailing list