-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
57 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* @page copyright | ||
* Copyright(c) 2020-present, Odysseas Georgoudis & quill contributors. | ||
* Distributed under the MIT License (http://opensource.org/licenses/MIT) | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "quill/core/Attributes.h" | ||
|
||
#include <chrono> | ||
#include <cstdint> | ||
|
||
QUILL_BEGIN_NAMESPACE | ||
|
||
namespace detail | ||
{ | ||
template <typename TClock> | ||
QUILL_NODISCARD QUILL_ATTRIBUTE_HOT std::chrono::nanoseconds get_timestamp() noexcept | ||
{ | ||
return std::chrono::duration_cast<std::chrono::nanoseconds>(TClock::now().time_since_epoch()); | ||
} | ||
|
||
template <typename TClock> | ||
QUILL_NODISCARD QUILL_ATTRIBUTE_HOT uint64_t get_timestamp_ns() noexcept | ||
{ | ||
return static_cast<uint64_t>(get_timestamp<TClock>().count()); | ||
} | ||
} // namespace detail | ||
|
||
QUILL_END_NAMESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters