Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
jlib
Commits
2fb21a9f
Commit
2fb21a9f
authored
Dec 17, 2019
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testing linux build 2
parent
4bb75322
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
timestamp.h
jlib/base/timestamp.h
+4
-4
No files found.
jlib/base/timestamp.h
View file @
2fb21a9f
...
...
@@ -25,22 +25,22 @@ using Timestamp = date::sys_time<std::chrono::microseconds>;
inline
Timestamp
nowTimestamp
()
{
return
floor
<
std
::
chrono
::
microseconds
>
(
std
::
chrono
::
system_clock
::
now
());
}
//! (first - second) duration in micro-seconds
inline
constexpr
long
long
timeDifference
(
const
Timestamp
&
first
,
const
Timestamp
&
second
)
{
inline
long
long
timeDifference
(
const
Timestamp
&
first
,
const
Timestamp
&
second
)
{
return
floor
<
std
::
chrono
::
microseconds
>
(
first
-
second
).
count
();
}
//! (nowTimestamp - t) duration in micro-seconds
inline
constexpr
long
long
timeDifference
(
const
Timestamp
&
t
)
{
inline
long
long
timeDifference
(
const
Timestamp
&
t
)
{
return
floor
<
std
::
chrono
::
microseconds
>
(
nowTimestamp
()
-
t
).
count
();
}
//! (first - second) duration in seconds(double)
inline
constexpr
double
timeDifferenceInS
(
const
Timestamp
&
first
,
const
Timestamp
&
second
)
{
inline
double
timeDifferenceInS
(
const
Timestamp
&
first
,
const
Timestamp
&
second
)
{
return
static_cast
<
double
>
(
floor
<
std
::
chrono
::
microseconds
>
(
first
-
second
).
count
())
/
1000000
.
0
;
}
//! (nowTimestamp - t) duration in seconds(double)
inline
constexpr
double
timeDifferenceInS
(
const
Timestamp
&
t
)
{
inline
double
timeDifferenceInS
(
const
Timestamp
&
t
)
{
return
static_cast
<
double
>
(
floor
<
std
::
chrono
::
microseconds
>
(
nowTimestamp
()
-
t
).
count
())
/
1000000
.
0
;
}
...
...
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