Browse Source

misc

master
Jonathan Strong 6 years ago
parent
commit
2930c261c0
2 changed files with 1 additions and 16 deletions
  1. +1
    -15
      src/latency.rs
  2. +0
    -1
      src/lib.rs

+ 1
- 15
src/latency.rs View File

@@ -1,3 +1,4 @@
#![allow(unused)]
use std::thread::{self, JoinHandle};
use std::sync::mpsc::{Sender, channel};
use std::fmt;
@@ -373,21 +374,6 @@ mod windows {
#[inline]
pub fn nanos(d: Duration) -> u64 { d.as_secs() * 1_000_000_000 + (d.subsec_nanos() as u64) }

/// Returns number of microseconds as `u32` if `d <= Duration::new(4_294, 967_295_000)`.
///
/// Any duration above ~4,295 seconds as micros is larger than `u32::MAX`. 4,295 seconds
/// is about 71.5 minutes.
///
/// # Examples
///
/// ```
/// use windows::DurationWindow;
/// use std::time::Duration;
///
/// assert_eq!(DurationWindow::micros(Duration::new(1, 0)), Some(1_000_000));
/// assert_eq!(DurationWindow::micros(Duration::new(4_295, 0)), None);
/// ```
///
#[inline]
pub fn micros(d: Duration) -> Option<u32> {
if d <= Duration::new(4_294, 967_295_000) {


+ 0
- 1
src/lib.rs View File

@@ -25,7 +25,6 @@ extern crate hdrhistogram;
extern crate smallvec;
extern crate num;

//extern crate windows;
extern crate pubsub as pub_sub;

use chrono::{DateTime, Utc};


Loading…
Cancel
Save