INNER CODE UNIT · Rust

stop

tangle-network/blueprint · crates/benchmarking/src/lib.rs:121

    pub fn stop<N: ToString>(&self, name: N, job_id: u8) -> BenchmarkSummary {
        let pid = sysinfo::get_current_pid().expect("Failed to get current process ID");
        let s = sysinfo::System::new_all();
        let process = s
            .process(pid)
            .expect("Failed to get current process from the system");
        let ram_usage = process.memory();
        BenchmarkSummary {
            name: name.to_string(),
            job_id,
            elapsed: self.started_at.elapsed(),
            cores: self.cores,
            ram_usage,
        }
    }
}

impl blueprint_std::fmt::Display for BenchmarkSummary {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…