From 738a69b17fb5c345c0264cb3f74b45e9f37d88c0 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Thu, 13 Feb 2020 09:55:32 +0100 Subject: [PATCH] Remove printing of numbers to increase speed --- src/main.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6dcc538..f195e2a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,6 @@ fn main() { go!(move || { get_primes(1 + (2 * &i) as u64, (&num_threads * 2) as u64, 2_000_000, &tx); }); - println!("Started thread {}", i); } let time_start = Instant::now(); let mut primes: Vec = vec![]; @@ -26,7 +25,6 @@ fn main() { Err(_) => break, Ok(prime) => { primes.push(prime); - println!("\r{: <30}", prime); } } } @@ -34,7 +32,6 @@ fn main() { for prime in primes { prime_sum += prime as u128; } - println!(); println!("Prime Sum: {}", prime_sum); println!("Solution took: {} ms", time_start.elapsed().as_millis()) } @@ -42,7 +39,6 @@ fn main() { /// Calculates primes and increases by incr with every iteration /// Resulting prime numbers are sent via the tx sender. fn get_primes(start: u64, incr: u64, stop_after: u64, tx: &Sender) { - println!("Hi, I'm a thread."); let mut num = start; while num < stop_after { let mut is_prime = true;