1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*********************************************
Reactor Geometry Generator
Argonne National Laboratory

CClock class definition.
*********************************************/
#include "meshkit/clock.hpp"

CClock::CClock ()
// ---------------------------------------------------------------------------
// Function: ctor. marks the current time
// Input:    none
// Output:   none
// ---------------------------------------------------------------------------
{
  time (&m_Time); 
}

CClock::CClock (const CClock& Time)
// ---------------------------------------------------------------------------
// Function: copy constructor
// Input:    none
// Output:   none
// ---------------------------------------------------------------------------
{
  m_Time = Time.m_Time;
}

CClock::~CClock()
// ---------------------------------------------------------------------------
// Function: destructor
// Input:    none
// Output:   none
// ---------------------------------------------------------------------------
{
}

double CClock::DiffTime (const CClock& Time) const
// ---------------------------------------------------------------------------
// Function: computes difference in time (in seconds) between
//           two time instances
// Input:    one of the time instances
// Output:   none
// ---------------------------------------------------------------------------
{
  return (difftime (Time.m_Time, m_Time));
}

double CClock::DiffTime () const
// ---------------------------------------------------------------------------
// Function: computes difference in time (in seconds) between
//           current time and marked time
// Input:    none
// Output:   none
// ---------------------------------------------------------------------------
{
  time_t CurTime;
  time (&CurTime);
  return (difftime (CurTime, m_Time));
}

    
void CClock::MarkTime ()<--- The function 'MarkTime' is never used.
// ---------------------------------------------------------------------------
// Function: marks the current time
// Input:    none
// Output:   none
// ---------------------------------------------------------------------------
{
  time (&m_Time); 
}

long CClock::GetMarkedTime () const<--- The function 'GetMarkedTime' is never used.
// ---------------------------------------------------------------------------
// Function: gets the marked time
// Input:    none
// Output:   none
// ---------------------------------------------------------------------------
{
  return static_cast<long>(m_Time); 
}

void CClock::GetDateTime (std::string& szDateTime) const
// ---------------------------------------------------------------------------
// Function: returns as a string the current date and time
// Input:    string to hold current date and time
// Output:   string containing the current date and time
// ---------------------------------------------------------------------------
{
  time_t rawtime;
  struct tm *timeinfo;

  time (&rawtime);
  timeinfo = localtime (&rawtime);
  szDateTime = asctime (timeinfo);<--- Obsolete function 'asctime' called. It is recommended to use the function 'strftime' instead.
}