packages/Utils/comm/Timer.cc
//---------------------------------------------------------------------------//
// MEMBER FUNCTIONS
//---------------------------------------------------------------------------//
/*!
 * \brief Print out a timing report.
 */
MEMBER FUNCTIONS
\brief Print out a timing report.
MEMBER FUNCTIONS \ brief Print out a timing report .
void Timer::print( std::ostream &out, int p ) const
{
    using std::setw;
    using std::endl;
    using std::ios;
    out.setf(ios::fixed, ios::floatfield);
    out.precision(p);
    out << '\n';
    if ( num_intervals > 1 )
        out << "LAST INTERVAL: " << '\n';
    out << setw(20) << "WALL CLOCK TIME: " << wall_clock() << " sec." << '\n';
    out << setw(20) << "  USER CPU TIME: " << user_cpu()   << " sec." << '\n';
    out << setw(20) << "SYSTEM CPU TIME: " << system_cpu() << " sec." << '\n';
    out << '\n';
    if ( num_intervals > 1 )
    {
        out << "OVER " << num_intervals << " INTERVALS: " << '\n';
        out << setw(20) << "WALL CLOCK TIME: " << sum_wall_clock()
            << " sec." << '\n';
        out << setw(20) << "  USER CPU TIME: " << sum_user_cpu()
            << " sec." << '\n';
        out << setw(20) << "SYSTEM CPU TIME: " << sum_system_cpu()
            << " sec." << '\n';
        out << '\n';
    }
    out.flush();
}
void Timer :: print ( std :: ostream & out , int p ) const { using std :: setw ; using std :: endl ; using std :: ios ; out . setf ( ios :: fixed , ios :: floatfield ) ; out . precision ( p ) ; out << ' \n ' ; if ( num_intervals > 1 ) out << " " << ' \n ' ; out << setw ( 20 ) << " " << wall_clock ( ) << " " << ' \n ' ; out << setw ( 20 ) << " " << user_cpu ( ) << " " << ' \n ' ; out << setw ( 20 ) << " " << system_cpu ( ) << " " << ' \n ' ; out << ' \n ' ; if ( num_intervals > 1 ) { out << " " << num_intervals << " " << ' \n ' ; out << setw ( 20 ) << " " << sum_wall_clock ( ) << " " << ' \n ' ; out << setw ( 20 ) << " " << sum_user_cpu ( ) << " " << ' \n ' ; out << setw ( 20 ) << " " << sum_system_cpu ( ) << " " << ' \n ' ; out << ' \n ' ; } out . flush ( ) ; }
MEMBER FUNCTIONS
 \brief Print out a timing report.
MEMBER FUNCTIONS \ brief Print out a timing report .