MFEM  v3.2
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
tic_toc.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_TIC_TOC
13 #define MFEM_TIC_TOC
14 
15 #include "../config/config.hpp"
16 
17 #ifndef MFEM_TIMER_TYPE
18 #ifndef _WIN32
19 #define MFEM_TIMER_TYPE 0
20 #else
21 #define MFEM_TIMER_TYPE 3
22 #endif
23 #endif
24 
25 namespace mfem
26 {
27 
28 namespace internal
29 {
30 class StopWatch;
31 }
32 
34 class StopWatch
35 {
36 private:
37  internal::StopWatch *M;
38 
39 public:
40  StopWatch();
41  void Clear();
42  void Start();
43  void Stop();
44  double Resolution();
45  double RealTime();
46  double UserTime();
47  double SystTime();
48  ~StopWatch();
49 };
50 
51 
52 extern StopWatch tic_toc;
53 
55 extern void tic();
56 
58 extern double toc();
59 
60 }
61 
62 #endif
StopWatch tic_toc
Definition: tic_toc.cpp:338
double RealTime()
Definition: tic_toc.cpp:317
double UserTime()
Definition: tic_toc.cpp:322
Timing object.
Definition: tic_toc.hpp:34
double Resolution()
Definition: tic_toc.cpp:312
void tic()
Start timing.
Definition: tic_toc.cpp:340
double toc()
End timing.
Definition: tic_toc.cpp:346
double SystTime()
Definition: tic_toc.cpp:327