mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
deps(common_utils): put the async ext trait behind a feature (#835)
This commit is contained in:
@ -17,9 +17,11 @@ pub mod validation;
|
||||
pub mod date_time {
|
||||
use std::num::NonZeroU8;
|
||||
|
||||
#[cfg(feature = "async_ext")]
|
||||
use time::Instant;
|
||||
use time::{
|
||||
format_description::well_known::iso8601::{Config, EncodedConfig, Iso8601, TimePrecision},
|
||||
Instant, OffsetDateTime, PrimitiveDateTime,
|
||||
OffsetDateTime, PrimitiveDateTime,
|
||||
};
|
||||
/// Struct to represent milliseconds in time sensitive data fields
|
||||
#[derive(Debug)]
|
||||
@ -42,6 +44,7 @@ pub mod date_time {
|
||||
}
|
||||
|
||||
/// Calculate execution time for a async block in milliseconds
|
||||
#[cfg(feature = "async_ext")]
|
||||
pub async fn time_it<T, Fut: futures::Future<Output = T>, F: FnOnce() -> Fut>(
|
||||
block: F,
|
||||
) -> (T, f64) {
|
||||
|
||||
Reference in New Issue
Block a user