accounting.hpp 876 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2005 The Trustees of Indiana University.
  2. // Use, modification and distribution is subject to the Boost Software
  3. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // Authors: Douglas Gregor
  6. // Andrew Lumsdaine
  7. #ifndef BOOST_GRAPH_ACCOUNTING_HPP
  8. #define BOOST_GRAPH_ACCOUNTING_HPP
  9. #include <iomanip>
  10. #include <iostream>
  11. #include <string>
  12. #include <sstream>
  13. #include <boost/mpi/config.hpp>
  14. namespace boost { namespace graph { namespace accounting {
  15. typedef double time_type;
  16. inline time_type get_time()
  17. {
  18. return MPI_Wtime();
  19. }
  20. inline std::string print_time(time_type t)
  21. {
  22. std::ostringstream out;
  23. out << std::setiosflags(std::ios::fixed) << std::setprecision(2) << t;
  24. return out.str();
  25. }
  26. } } } // end namespace boost::graph::accounting
  27. #endif // BOOST_GRAPH_ACCOUNTING_HPP