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