Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
fc7d5eaf
Commit
fc7d5eaf
authored
Apr 09, 2019
by
baujc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new function fixedDelta_to_pp_time
parent
6e6cffc7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
ppsi.h
include/ppsi/ppsi.h
+1
-0
time-arith.c
lib/time-arith.c
+8
-0
No files found.
include/ppsi/ppsi.h
View file @
fc7d5eaf
...
...
@@ -377,6 +377,7 @@ extern TimeInterval picos_to_interval(int64_t picos);
extern
void
pp_time_add_interval
(
struct
pp_time
*
t1
,
TimeInterval
t2
);
extern
void
pp_time_sub_interval
(
struct
pp_time
*
t1
,
TimeInterval
t2
);
extern
int
pp_timeout_log_to_ms
(
Integer8
logValue
);
extern
void
fixedDelta_to_pp_time
(
struct
FixedDelta
fd
,
struct
pp_time
*
t
);
/* Function for time conversion */
extern
int64_t
pp_time_to_picos
(
struct
pp_time
*
ts
);
...
...
lib/time-arith.c
View file @
fc7d5eaf
...
...
@@ -101,6 +101,14 @@ int64_t pp_time_to_picos(struct pp_time *ts)
+
((
ts
->
scaled_nsecs
*
1000
+
TIME_ROUNDING_VALUE
)
>>
TIME_FRACBITS
);
}
void
fixedDelta_to_pp_time
(
struct
FixedDelta
fd
,
struct
pp_time
*
t
)
{
/* FixedDelta is expressed in ps*2^16 */
uint64_t
*
v
=
(
uint64_t
*
)
&
fd
;
t
->
scaled_nsecs
=*
v
/
1000L
;
/* We can do it because scaled_nsecs is also multiply by 2^16 */
t
->
secs
=
0
;
normalize_pp_time
(
t
);
}
void
picos_to_pp_time
(
int64_t
picos
,
struct
pp_time
*
ts
)
{
uint64_t
sec
,
nsec
;
...
...
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