OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
src
src
Utilities
Timer.cpp
Go to the documentation of this file.
1
// ------------------------------------------------------------------------
2
// $RCSfile: Timer.cpp,v $
3
// ------------------------------------------------------------------------
4
// $Revision: 1.1.1.1 $
5
// ------------------------------------------------------------------------
6
// Copyright: see Copyright.readme
7
// ------------------------------------------------------------------------
8
//
9
// Class: Timer
10
// Get Calendar date and time.
11
//
12
// ------------------------------------------------------------------------
13
//
14
// $Date: 2000/03/27 09:33:48 $
15
// $Author: Andreas Adelmann $
16
//
17
// ------------------------------------------------------------------------
18
19
#include "
Utilities/Timer.h
"
20
#include <ctime>
21
22
namespace
OPALTimer
{
23
// Class Timer
24
// ------------------------------------------------------------------------
25
26
Timer::Timer
() {
27
::time
(&
timer
);
28
}
29
30
31
Timer::~Timer
()
32
{}
33
34
35
std::string
Timer::date
()
const
{
36
char
buffer[12];
37
strftime(buffer, 12,
"%d/%m/%Y"
, localtime(&
timer
));
38
return
std::string(buffer, 10);
39
}
40
41
42
std::string
Timer::time
()
const
{
43
char
buffer[12];
44
strftime(buffer, 12,
"%H:%M:%S"
, localtime(&
timer
));
45
return
std::string(buffer, 8);
46
}
47
}
OPALTimer
Timer class.
Definition:
Timer.cpp:22
OPALTimer::Timer::~Timer
~Timer()
Definition:
Timer.cpp:31
OPALTimer::Timer::timer
time_t timer
Definition:
Timer.h:55
OPALTimer::Timer::date
std::string date() const
Return date.
Definition:
Timer.cpp:35
OPALTimer::Timer::Timer
Timer()
Constructor.
Definition:
Timer.cpp:26
OPALTimer::Timer::time
std::string time() const
Return time.
Definition:
Timer.cpp:42
Timer.h
Generated on Wed Aug 25 2021 16:41:05 for OPAL (Object Oriented Parallel Accelerator Library) by
1.9.1