Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
207de87e
Commit
207de87e
authored
Apr 24, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue causing infinite loop
parent
558f0fa2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
latency-measure/src/main.c
latency-measure/src/main.c
+4
-1
No files found.
latency-measure/src/main.c
View file @
207de87e
...
@@ -36,6 +36,9 @@ static inline int64_t diff_ns(struct timespec t1, struct timespec t2) {
...
@@ -36,6 +36,9 @@ static inline int64_t diff_ns(struct timespec t1, struct timespec t2) {
diff
=
NSECS_PER_SECOND
*
(
t1
.
tv_sec
-
t2
.
tv_sec
);
diff
=
NSECS_PER_SECOND
*
(
t1
.
tv_sec
-
t2
.
tv_sec
);
diff
+=
((
int64_t
)
t1
.
tv_nsec
)
-
((
int64_t
)
t2
.
tv_nsec
);
diff
+=
((
int64_t
)
t1
.
tv_nsec
)
-
((
int64_t
)
t2
.
tv_nsec
);
if
(
diff
<
0
)
diff
=
-
diff
;
return
diff
;
return
diff
;
}
}
...
@@ -91,7 +94,7 @@ static void *timerthread_poll(void *p) {
...
@@ -91,7 +94,7 @@ static void *timerthread_poll(void *p) {
for
(;;)
{
for
(;;)
{
clock_gettime
(
CLOCK_ID
,
&
current
);
clock_gettime
(
CLOCK_ID
,
&
current
);
if
(
current
.
tv_nsec
=
=
next
.
tv_nsec
)
if
(
current
.
tv_nsec
>
=
next
.
tv_nsec
)
break
;
break
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment