27 #ifndef MLN_UTIL_TIMER_HH
28 # define MLN_UTIL_TIMER_HH
34 # include <mln/core/concept/proxy.hh>
46 public mln::internal::proxy_impl<float, timer>
54 void operator=(
const timer&);
85 return double(std::clock()) * 1000.f / CLOCKS_PER_SEC;
96 # ifndef MLN_INCLUDE_ONLY
114 mln_precondition(running_ ==
false);
115 start_ = float(std::clock()) / CLOCKS_PER_SEC;
124 mln_precondition(running_ ==
true);
125 time_ += float(std::clock()) / CLOCKS_PER_SEC - start_;
134 mln_precondition(running_ ==
false);
135 start_ = float(std::clock()) / CLOCKS_PER_SEC;
161 mln_precondition(start_ != -1);
163 time_ + float(std::clock()) / CLOCKS_PER_SEC - start_ :
171 mln_precondition(start_ != -1);
175 # endif // ! MLN_INCLUDE_ONLY
182 #endif // ! MLN_UTIL_TIMER_HH