Mercurial > lbo > hg > leveldb-rs
view src/env_common.rs @ 553:bd8c4d4688d5
use conforming format for snappy compression
This finally enables reading/writing compressed leveldbs written by the original implementation. Before this,
the incompatible compression format prevented this.
Fixes #17
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Thu, 30 Jun 2022 21:09:05 -0700 |
parents | 0c3b736b2781 |
children |
line wrap: on
line source
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)); }