Skip to content

Commit

Permalink
Backport Timestamp::MAX from dev
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-casperlabs committed Feb 9, 2023
1 parent 1874307 commit 2db3a68
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions node/src/types/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ static TIMESTAMP_EXAMPLE: Lazy<Timestamp> = Lazy::new(|| {
pub struct Timestamp(u64);

impl Timestamp {
/// The maximum value a timestamp can have.
pub const MAX: Timestamp = Timestamp(u64::MAX);

/// Returns the timestamp of the current moment.
pub fn now() -> Self {
let millis = SystemTime::UNIX_EPOCH.elapsed().unwrap().as_millis() as u64;
Expand Down

0 comments on commit 2db3a68

Please sign in to comment.