MFEM v2.0
|
00001 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at 00002 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights 00003 // reserved. See file COPYRIGHT for details. 00004 // 00005 // This file is part of the MFEM library. For more information and source code 00006 // availability see http://mfem.googlecode.com. 00007 // 00008 // MFEM is free software; you can redistribute it and/or modify it under the 00009 // terms of the GNU Lesser General Public License (as published by the Free 00010 // Software Foundation) version 2.1 dated February 1999. 00011 00012 #ifndef MFEM_TIC_TOC 00013 #define MFEM_TIC_TOC 00014 00015 #include <sys/times.h> 00016 00018 class StopWatch 00019 { 00020 private: 00021 clock_t real_time, user_time, syst_time; 00022 clock_t start_rtime, start_utime, start_stime; 00023 long my_CLK_TCK; 00024 short Running; 00025 void Current(clock_t *, clock_t *, clock_t *); 00026 public: 00027 StopWatch(); // determines my_CLK_TCK 00028 void Clear(); 00029 void Start(); 00030 void Stop(); 00031 double RealTime(); 00032 double UserTime(); 00033 double SystTime(); 00034 }; 00035 00036 00037 extern StopWatch tic_toc; 00038 00040 extern void tic(); 00041 00043 extern double toc(); 00044 00045 #endif