Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
RobotAPI
Commits
61547a00
Commit
61547a00
authored
1 year ago
by
Christoph Pohl
Committed by
ARMAR-DE
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Minor improvements for RtTiming
Signed-off-by: ARMAR-DE <>
parent
abe54c44
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/components/units/RobotUnit/util/RtTiming.h
+10
-3
10 additions, 3 deletions
source/RobotAPI/components/units/RobotUnit/util/RtTiming.h
with
10 additions
and
3 deletions
source/RobotAPI/components/units/RobotUnit/util/RtTiming.h
+
10
−
3
View file @
61547a00
...
...
@@ -24,18 +24,25 @@
#pragma once
#include
<chrono>
//#include <ArmarXCore/core/time/TimeUtil.h>
#include
"ControlThreadOutputBuffer.h"
namespace
armarx
{
namespace
rt_timing
::
constants
{
inline
constexpr
const
std
::
int64_t
seconds2MicroSeconds
=
1e6
;
static
constexpr
const
std
::
int64_t
nanoSeconds2MicroSeconds
=
1000
;
}
// namespace rt_timing::constants
inline
IceUtil
::
Time
rtNow
()
{
using
namespace
rt_timing
::
constants
;
struct
timespec
ts
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
ts
);
return
IceUtil
::
Time
::
microSeconds
(
ts
.
tv_sec
*
1e6
+
ts
.
tv_nsec
/
1000
);
return
IceUtil
::
Time
::
microSeconds
(
ts
.
tv_sec
*
seconds2MicroSeconds
+
ts
.
tv_nsec
/
nanoSeconds2MicroSeconds
);
}
}
// namespace armarx
...
...
@@ -52,7 +59,7 @@ namespace armarx
//! \ingroup VirtualTime
//! Prints duration with comment in front of it if it took longer than threshold
#define RT_TIMING_CEND_COMMENT(name, comment, thresholdMs) \
if ((armarx::rtNow() - name).toMilliSeconds() >= thresholdMs)
\
if ((armarx::rtNow() - name).toMilliSeconds
Double
() >= thresholdMs) \
RT_TIMING_END_COMMENT(name, comment)
//! \ingroup VirtualTime
//! Prints duration if it took longer than thresholdMs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment