Sha256: 3ad469de5a650389699c9ffe5fd78af2bdd46e7140cc05391c60d793fc6f8e98

Contents?: true

Size: 644 Bytes

Versions: 19

Compression:

Stored size: 644 Bytes

Contents

use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread::spawn;

use iana_time_zone::get_timezone;

const THREADS: usize = 10;
const ITERATIONS: usize = 100_000;

static COUNT: AtomicUsize = AtomicUsize::new(0);

fn main() {
    let mut threads = Vec::with_capacity(THREADS);
    for _ in 0..THREADS {
        threads.push(spawn(|| {
            for _ in 0..ITERATIONS {
                get_timezone().unwrap();
                COUNT.fetch_add(1, Ordering::Relaxed);
            }
        }));
    }
    for thread in threads {
        thread.join().unwrap();
    }
    assert_eq!(COUNT.load(Ordering::SeqCst), THREADS * ITERATIONS);
}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/iana-time-zone-0.1.61/examples/stress-test.rs
wasmtime-28.0.0 ./ext/cargo-vendor/iana-time-zone-0.1.61/examples/stress-test.rs
wasmtime-27.0.0 ./ext/cargo-vendor/iana-time-zone-0.1.61/examples/stress-test.rs
wasmtime-26.0.0 ./ext/cargo-vendor/iana-time-zone-0.1.61/examples/stress-test.rs
wasmtime-25.0.2 ./ext/cargo-vendor/iana-time-zone-0.1.60/examples/stress-test.rs
wasmtime-25.0.1 ./ext/cargo-vendor/iana-time-zone-0.1.60/examples/stress-test.rs
wasmtime-25.0.0 ./ext/cargo-vendor/iana-time-zone-0.1.60/examples/stress-test.rs
wasmtime-24.0.0 ./ext/cargo-vendor/iana-time-zone-0.1.60/examples/stress-test.rs
wasmtime-23.0.2 ./ext/cargo-vendor/iana-time-zone-0.1.59/examples/stress-test.rs
wasmtime-22.0.0 ./ext/cargo-vendor/iana-time-zone-0.1.59/examples/stress-test.rs
wasmtime-21.0.1 ./ext/cargo-vendor/iana-time-zone-0.1.59/examples/stress-test.rs
wasmtime-20.0.2 ./ext/cargo-vendor/iana-time-zone-0.1.59/examples/stress-test.rs
wasmtime-20.0.0 ./ext/cargo-vendor/iana-time-zone-0.1.59/examples/stress-test.rs
wasmtime-18.0.3 ./ext/cargo-vendor/iana-time-zone-0.1.59/examples/stress-test.rs
wasmtime-17.0.1 ./ext/cargo-vendor/iana-time-zone-0.1.59/examples/stress-test.rs
wasmtime-17.0.0 ./ext/cargo-vendor/iana-time-zone-0.1.59/examples/stress-test.rs
wasmtime-16.0.0 ./ext/cargo-vendor/iana-time-zone-0.1.59/examples/stress-test.rs
wasmtime-15.0.1 ./ext/cargo-vendor/iana-time-zone-0.1.59/examples/stress-test.rs
wasmtime-15.0.0 ./ext/cargo-vendor/iana-time-zone-0.1.59/examples/stress-test.rs