From 8f631cb6b50e3a877f73f4126fab46ce16bd1979 Mon Sep 17 00:00:00 2001 From: b1ek Date: Wed, 2 Aug 2023 21:48:07 +1000 Subject: [PATCH] add multithreaded example --- examples/multithreaded.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 examples/multithreaded.rs diff --git a/examples/multithreaded.rs b/examples/multithreaded.rs new file mode 100644 index 0000000..84ffb51 --- /dev/null +++ b/examples/multithreaded.rs @@ -0,0 +1,8 @@ + +use powlib::{gen::{POWRange, POWChallenge}, solver::POWSolver}; + +fn main() { + let challenge = POWChallenge::make(POWRange::new(0, 20480)); + let mut solver = POWSolver::new(challenge); + println!("Found {} with 8 threads", solver.solve_blocking(8, Some(|x| println!("{x}")))); +} \ No newline at end of file