linera-exporter 0.15.21

Block exporter for the Linera protocol.
Documentation
1
2
3
4
5
6
7
8
9
10
// Copyright (c) Zefchain Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

use std::{num::ParseIntError, time::Duration};

/// Parses a string of milliseconds into a [`Duration`].
pub fn parse_millis(s: &str) -> Result<Duration, ParseIntError> {
    let millis = s.parse::<u64>()?;
    Ok(Duration::from_millis(millis))
}