Skip to content

Commit

Permalink
add debugtrap utility.
Browse files Browse the repository at this point in the history
  • Loading branch information
jevolk committed Mar 19, 2024
1 parent a10607c commit a79db7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![feature(core_intrinsics)]

pub mod api;
pub mod clap;
mod config;
Expand Down
6 changes: 6 additions & 0 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ use ruma::{canonical_json::try_from_json_map, CanonicalJsonError, CanonicalJsonO

use crate::{services, Error, Result};

#[inline(always)]
#[allow(dead_code)]
pub(crate) fn debugtrap() {
unsafe { std::intrinsics::breakpoint(); }
}

pub(crate) fn millis_since_unix_epoch() -> u64 {
SystemTime::now().duration_since(UNIX_EPOCH).expect("time is valid").as_millis() as u64
}
Expand Down

0 comments on commit a79db7d

Please sign in to comment.