Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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
cpp-libs
Actor Framework
Commits
28cd6b5d
Commit
28cd6b5d
authored
Nov 19, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/timestamp-to-string'
parents
3d927140
065ca165
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
libcaf_core/caf/timestamp.hpp
libcaf_core/caf/timestamp.hpp
+5
-5
libcaf_core/src/timestamp.cpp
libcaf_core/src/timestamp.cpp
+5
-4
No files found.
libcaf_core/caf/timestamp.hpp
View file @
28cd6b5d
...
@@ -33,11 +33,11 @@ using timestamp = std::chrono::time_point<std::chrono::system_clock, timespan>;
...
@@ -33,11 +33,11 @@ using timestamp = std::chrono::time_point<std::chrono::system_clock, timespan>;
/// the current system time.
/// the current system time.
timestamp
make_timestamp
();
timestamp
make_timestamp
();
///
Converts the time-since-epoch of `x` to a `string
`.
///
Prints `x` in ISO 8601 format, e.g., `2018-11-15T06:25:01.462
`.
std
::
string
timestamp_to_string
(
const
timestamp
&
x
);
std
::
string
timestamp_to_string
(
timestamp
x
);
/// Appends the time-since-epoch of `y` to `x`.
/// Appends the timestamp `x` in ISO 8601 format, e.g.,
void
append_timestamp_to_string
(
std
::
string
&
x
,
const
timestamp
&
y
);
/// `2018-11-15T06:25:01.462`, to `y`.
void
append_timestamp_to_string
(
std
::
string
&
x
,
timestamp
y
);
}
// namespace caf
}
// namespace caf
libcaf_core/src/timestamp.cpp
View file @
28cd6b5d
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
* http://www.boost.org/LICENSE_1_0.txt. *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
******************************************************************************/
#include "caf/deep_to_string.hpp"
#include "caf/timestamp.hpp"
#include "caf/timestamp.hpp"
namespace
caf
{
namespace
caf
{
...
@@ -24,12 +25,12 @@ timestamp make_timestamp() {
...
@@ -24,12 +25,12 @@ timestamp make_timestamp() {
return
std
::
chrono
::
system_clock
::
now
();
return
std
::
chrono
::
system_clock
::
now
();
}
}
std
::
string
timestamp_to_string
(
const
timestamp
&
x
)
{
std
::
string
timestamp_to_string
(
timestamp
x
)
{
return
std
::
to_string
(
x
.
time_since_epoch
().
count
());
return
deep_
to_string
(
x
.
time_since_epoch
().
count
());
}
}
void
append_timestamp_to_string
(
std
::
string
&
x
,
const
timestamp
&
y
)
{
void
append_timestamp_to_string
(
std
::
string
&
x
,
timestamp
y
)
{
x
+=
std
::
to_string
(
y
.
time_since_epoch
().
count
()
);
x
+=
timestamp_to_string
(
y
);
}
}
}
// namespace caf
}
// namespace caf
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