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>
72 return double(std::clock()) * 1000.f / CLOCKS_PER_SEC;
83 # ifndef MLN_INCLUDE_ONLY
101 mln_precondition(running_ ==
false);
102 start_ =
float(std::clock()) / CLOCKS_PER_SEC;
111 mln_precondition(running_ ==
true);
112 time_ +=
float(std::clock()) / CLOCKS_PER_SEC - start_;
121 mln_precondition(running_ ==
false);
122 start_ =
float(std::clock()) / CLOCKS_PER_SEC;
148 mln_precondition(start_ != -1);
150 time_ +
float(std::clock()) / CLOCKS_PER_SEC - start_ :
158 mln_precondition(start_ != -1);
162 # endif // ! MLN_INCLUDE_ONLY
169 #endif // ! MLN_UTIL_TIMER_HH