rusty-leveldb 4.0.1

A compatible re-implementation of LevelDB in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::thread;
use std::time;

pub fn micros() -> u64 {
    loop {
        let now = time::SystemTime::now().duration_since(time::UNIX_EPOCH);

        match now {
            Err(_) => continue,
            Ok(dur) => return dur.as_secs() * 1000000 + dur.subsec_micros() as u64,
        }
    }
}

pub fn sleep_for(micros: u32) {
    thread::sleep(time::Duration::new(0, micros * 1000));
}