MFEM  v4.1.0
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-2020, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
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 
33 /// Timing object
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 
54 /// Start timing
55 extern void tic();
56 
57 /// End timing
58 extern double toc();
59 
60 }
61 
62 #endif
StopWatch tic_toc
Definition: tic_toc.cpp:447
double RealTime()
Definition: tic_toc.cpp:426
double UserTime()
Definition: tic_toc.cpp:431
Timing object.
Definition: tic_toc.hpp:34
double Resolution()
Definition: tic_toc.cpp:421
void tic()
Start timing.
Definition: tic_toc.cpp:449
double toc()
End timing.
Definition: tic_toc.cpp:455
double SystTime()
Definition: tic_toc.cpp:436