Changeset a3769cc for benchmark/bench.rs
- Timestamp:
- Sep 14, 2021, 10:21:11 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- b8454c6
- Parents:
- 347925c (diff), ebb6158 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/bench.rs
r347925c ra3769cc 1 1 use std::io::{self, Write}; 2 use std::option; 2 3 use std::sync::atomic::{AtomicU64, AtomicBool, Ordering}; 3 4 use std::time::{Instant,Duration}; 5 use std::u128; 4 6 5 7 use clap::{Arg, ArgMatches}; … … 27 29 28 30 impl BenchData { 29 pub fn new(options: ArgMatches, nthreads: usize ) -> BenchData {31 pub fn new(options: ArgMatches, nthreads: usize, default_it: option::Option<u64>) -> BenchData { 30 32 let (clock_mode, stop_count, duration) = if options.is_present("iterations") { 31 33 (false, 32 34 options.value_of("iterations").unwrap().parse::<u64>().unwrap(), 35 -1.0) 36 } else if !default_it.is_none() { 37 (false, 38 default_it.unwrap(), 33 39 -1.0) 34 40 } else { … … 48 54 } 49 55 56 #[allow(dead_code)] 50 57 pub async fn wait(&self, start: &Instant) -> Duration{ 51 58 loop { … … 69 76 } 70 77 78 // ================================================== 79 pub fn _lehmer64( state: &mut u128 ) -> u64 { 80 *state = state.wrapping_mul(0xda942042e4dd58b5); 81 return (*state >> 64) as u64; 82 }
Note: See TracChangeset
for help on using the changeset viewer.