Changeset a3769cc for benchmark/bench.rs


Ignore:
Timestamp:
Sep 14, 2021, 10:21:11 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/bench.rs

    r347925c ra3769cc  
    11use std::io::{self, Write};
     2use std::option;
    23use std::sync::atomic::{AtomicU64, AtomicBool, Ordering};
    34use std::time::{Instant,Duration};
     5use std::u128;
    46
    57use clap::{Arg, ArgMatches};
     
    2729
    2830impl BenchData {
    29         pub fn new(options: ArgMatches, nthreads: usize) -> BenchData {
     31        pub fn new(options: ArgMatches, nthreads: usize, default_it: option::Option<u64>) -> BenchData {
    3032                let (clock_mode, stop_count, duration) = if options.is_present("iterations") {
    3133                        (false,
    3234                        options.value_of("iterations").unwrap().parse::<u64>().unwrap(),
     35                        -1.0)
     36                } else if !default_it.is_none() {
     37                        (false,
     38                        default_it.unwrap(),
    3339                        -1.0)
    3440                } else {
     
    4854        }
    4955
     56        #[allow(dead_code)]
    5057        pub async fn wait(&self, start: &Instant) -> Duration{
    5158                loop {
     
    6976}
    7077
     78// ==================================================
     79pub 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.