Skip to content

Instantly share code, notes, and snippets.

services:
postgres:
image: postgres:17 # You can choose a specific version or use 'latest'
# container_name: file_uploader_db
restart: unless-stopped
environment:
POSTGRES_USER: postgres # Replace with your desired username
POSTGRES_PASSWORD: V6dAaH0ch4qCFB5dvR1FX1BZai1F3f # Replace with your desired password
POSTGRES_DB: orchestrator_db # Replace with your desired database name
ports:
@PY44N
PY44N / profiler.rs
Created July 6, 2023 17:56
A simple function for profiling Rust code
use lazy_static::lazy_static;
lazy_static! {
static ref PROFILED_SPEEDS: Mutex<HashMap<String, Vec<u64>>> = Mutex::new(HashMap::new());
}
fn profile<T>(name: &str, test: &mut impl FnMut() -> T) -> T {
let start = SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()