OPALX (Object Oriented Parallel Accelerator Library for Exascal)
master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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
() {
::time
(&
timer
); }
27
28
Timer::~Timer
() {}
29
30
std::string
Timer::date
()
const
{
31
char
buffer[12];
32
strftime(buffer, 12,
"%d/%m/%Y"
, localtime(&
timer
));
33
return
std::string(buffer, 10);
34
}
35
36
std::string
Timer::time
()
const
{
37
char
buffer[12];
38
strftime(buffer, 12,
"%H:%M:%S"
, localtime(&
timer
));
39
return
std::string(buffer, 8);
40
}
41
}
// namespace OPALTimer
Timer.h
OPALTimer::Timer::timer
time_t timer
Definition
Timer.h:51
OPALTimer::Timer::~Timer
~Timer()
Definition
Timer.cpp:28
OPALTimer::Timer::Timer
Timer()
Constructor.
Definition
Timer.cpp:26
OPALTimer::Timer::time
std::string time() const
Return time.
Definition
Timer.cpp:36
OPALTimer::Timer::date
std::string date() const
Return date.
Definition
Timer.cpp:30
OPALTimer
Timer class.
Definition
Timer.cpp:22
src
Utilities
Timer.cpp
Generated on Mon Jun 1 2026 10:40:53 for OPALX (Object Oriented Parallel Accelerator Library for Exascal) by
1.9.8