F´ Flight Software - C/C++ Documentation
NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
z
Functions
a
b
c
d
g
h
i
m
o
p
r
s
t
v
w
Variables
Typedefs
a
b
c
e
f
g
h
l
n
o
p
r
s
t
w
Enumerations
Enumerator
a
b
f
h
i
n
o
p
s
v
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Variables
a
b
c
d
e
f
g
h
i
l
m
n
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
w
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
u
v
Functions
f
i
m
p
r
s
t
u
Variables
Typedefs
a
b
c
e
f
i
n
p
s
u
Enumerations
Enumerator
Macros
_
a
c
d
f
g
h
i
l
m
p
r
s
t
u
v
►
F´ Flight Software - C/C++ Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
IntervalTimer.cpp
Go to the documentation of this file.
1
14
#include <
Os/IntervalTimer.hpp
>
15
#include <
Fw/Types/Assert.hpp
>
16
#include <cstring>
17
18
namespace
Os
{
19
20
// Adapted from: http://www.gnu.org/software/libc/manual/html_node/Elapsed-Time.html
21
// should be t1In - t2In
22
U32
IntervalTimer::getDiffUsec
(
const
RawTime& t1In,
const
RawTime& t2In) {
23
RawTime result = {t1In.upper - t2In.upper, 0};
24
if
(t1In.lower < t2In.lower) {
25
result.upper -= 1;
// subtract nsec carry to seconds
26
result.lower = t1In.lower + (1000000000 - t2In.lower);
27
}
else
{
28
result.lower = t1In.lower - t2In.lower;
29
}
30
return
(result.upper * 1000000) + (result.lower / 1000);
31
}
32
}
Assert.hpp
IntervalTimer.hpp
Os::IntervalTimer::getDiffUsec
U32 getDiffUsec()
Definition
IntervalTimerCommon.cpp:34
Os
Definition
File.cpp:6
Os
X86
IntervalTimer.cpp
Generated by
1.9.7