Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
Home
Manual
API Reference
Download
Bugzilla
Groups
Namespace List
Class List
File List
Examples
File List
File Members
mitkLinuxRealTimeClock.cpp
Go to the documentation of this file.
1
/*===================================================================
2
3
The Medical Imaging Interaction Toolkit (MITK)
4
5
Copyright (c) German Cancer Research Center,
6
Division of Medical and Biological Informatics.
7
All rights reserved.
8
9
This software is distributed WITHOUT ANY WARRANTY; without
10
even the implied warranty of MERCHANTABILITY or FITNESS FOR
11
A PARTICULAR PURPOSE.
12
13
See LICENSE.txt or http://www.mitk.org for details.
14
15
===================================================================*/
16
17
#include "
mitkLinuxRealTimeClock.h
"
18
19
#include <sys/time.h>
20
21
25
mitk::LinuxRealTimeClock::LinuxRealTimeClock
()
26
{
27
}
28
32
mitk::LinuxRealTimeClock::~LinuxRealTimeClock
()
33
{
34
}
35
44
double
mitk::LinuxRealTimeClock::GetCurrentStamp
()
45
{
46
struct
timeval tval;
47
48
if
( ::gettimeofday( &tval,
nullptr
)!= 0 )
49
{
50
itkGenericOutputMacro(
"gettimeofday-method could not successfully acquire the current time"
);
51
return
-1;
52
}
53
double
milliseconds;
54
55
milliseconds =
static_cast<
double
>
( tval.tv_sec ) +
56
static_cast< double >( tval.tv_usec ) / 1e6;
57
58
return
milliseconds*1000;
// in milliseconds
59
}
mitk::LinuxRealTimeClock::GetCurrentStamp
virtual double GetCurrentStamp() override
returns the current time in milliseconds as a double
Definition:
mitkLinuxRealTimeClock.cpp:44
mitkLinuxRealTimeClock.h
mitk::LinuxRealTimeClock::LinuxRealTimeClock
LinuxRealTimeClock()
basic contructor
Definition:
mitkLinuxRealTimeClock.cpp:25
mitk::LinuxRealTimeClock::~LinuxRealTimeClock
virtual ~LinuxRealTimeClock()
basic contructor
Definition:
mitkLinuxRealTimeClock.cpp:32
git
MITK
Modules
IGTBase
src
mitkLinuxRealTimeClock.cpp
Generated on Fri Feb 3 2017 20:52:02 for Medical Imaging Interaction Toolkit by
1.8.9.1