Skip to content

Commit

Permalink
feat: add fgn speed test
Browse files Browse the repository at this point in the history
  • Loading branch information
dancixx committed Jan 5, 2025
1 parent 8fbedef commit 852e65f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/stochastic/noise/fgn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,23 @@ mod tests {
assert_eq!(fbm.sample().len(), N);
}

#[test]
fn fgn_speed_test() {
let start = std::time::Instant::now();
let fbm = FGN::new(0.7, N, Some(1.0), None);
let _ = fbm.sample();
let duration = start.elapsed();
println!("Time elapsed in sample() is: {:?}", duration);

let start = std::time::Instant::now();
let fbm = FGN::new(0.7, N, Some(1.0), None);
for _ in 0..N {
let _ = fbm.sample();
}
let duration = start.elapsed();
println!("Time elapsed in sample() is: {:?}", duration);
}

#[test]
#[ignore = "Not implemented"]
fn fgn_starts_with_x0() {
Expand Down

0 comments on commit 852e65f

Please sign in to comment.