diff --git a/src/admin/debug/commands.rs b/src/admin/debug/commands.rs index 4efefce7..ff68641c 100644 --- a/src/admin/debug/commands.rs +++ b/src/admin/debug/commands.rs @@ -2,14 +2,14 @@ use std::{ collections::{BTreeMap, HashMap}, fmt::Write, sync::{Arc, Mutex}, - time::Instant, + time::{Instant, SystemTime}, }; use api::client::validate_and_add_event_id; use conduit::{ debug, info, log, log::{capture, Capture}, - warn, Error, PduEvent, Result, + utils, warn, Error, PduEvent, Result, }; use ruma::{ api::{client::error::ErrorKind, federation::event::get_room_state}, @@ -739,3 +739,8 @@ pub(super) async fn runtime_interval(_body: Vec<&str>) -> Result) -> Result { + let now = SystemTime::now(); + Ok(RoomMessageEventContent::text_markdown(utils::time::format(now, "%+"))) +} diff --git a/src/admin/debug/mod.rs b/src/admin/debug/mod.rs index 82b37c53..77bc36b8 100644 --- a/src/admin/debug/mod.rs +++ b/src/admin/debug/mod.rs @@ -175,6 +175,9 @@ pub(super) enum DebugCommand { /// invocation. RuntimeInterval, + /// - Print the current time + Time, + /// - Developer test stubs #[command(subcommand)] #[allow(non_snake_case)]