12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifndef BOOST_MPI_TIMER_HPP
- #define BOOST_MPI_TIMER_HPP
- #include <boost/mpi/config.hpp>
- #include <boost/limits.hpp>
- namespace boost { namespace mpi {
- class BOOST_MPI_DECL timer {
- public:
-
- timer();
-
- void restart();
-
- double elapsed() const;
-
- double elapsed_max() const;
-
- double elapsed_min() const;
-
- static bool time_is_global();
- private:
- double start_time;
- };
- inline timer::timer()
- {
- restart();
- }
- inline void timer::restart()
- {
- start_time = MPI_Wtime();
- }
- inline double timer::elapsed() const
- {
- return MPI_Wtime() - start_time;
- }
- inline double timer::elapsed_max() const
- {
- return (std::numeric_limits<double>::max)();
- }
- inline double timer::elapsed_min() const
- {
- return MPI_Wtick();
- }
- } }
- #endif
|