NeoPZ
TPZfTime.cpp
Go to the documentation of this file.
1 
7 #include "TPZfTime.h"
8 
9 using namespace std;
10 
12 {
13  ftime(&finicio);
14 }
15 
17 {
18 }
19 
21 {
22 
23  ftime(&ffinal);
24  double time = ((double) ffinal.time + ((double) ffinal.millitm * 0.001)) - ((double) finicio.time + ((double) finicio.millitm * 0.001));
25  stringstream oss;
26  string str;
27 
28  oss << time << " seconds\n";
29  str = oss.str();
30 
31  // printf("%f seconds\n", ((double) ffinal.time + ((double) ffinal.millitm * 0.001)) - ((double) finicio.time + ((double) finicio.millitm * 0.001)));
32  return str;
33 }
34 
36 {
37  ftime(&ffinal);
38  double time = ((double) ffinal.time + ((double) ffinal.millitm * 0.001)) - ((double) finicio.time + ((double) finicio.millitm * 0.001));
39 
40  return time;
41 }
~TPZfTime()
Default destructor.
Definition: TPZfTime.cpp:16
double ReturnTimeDouble()
When called, returns the time since the creation of the object in a double.
Definition: TPZfTime.cpp:35
Contains the TPZfTime class which calculates times.
std::string ReturnTimeString()
When called, returns the time since the creation of the object in a string.
Definition: TPZfTime.cpp:20
TPZfTime()
Start the timer when the object is created.
Definition: TPZfTime.cpp:11