diff options
-rw-r--r-- | src/tests/example_stack/Cargo.toml | 6 | ||||
-rw-r--r-- | src/tests/example_stack/benches/do_stuff.rs | 6 | ||||
-rw-r--r-- | src/tests/example_stack/src/lib.rs (renamed from src/tests/example_stack/src/main.rs) | 2 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/tests/example_stack/Cargo.toml b/src/tests/example_stack/Cargo.toml index 9827bef..3e3e617 100644 --- a/src/tests/example_stack/Cargo.toml +++ b/src/tests/example_stack/Cargo.toml @@ -6,4 +6,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -primrose-library = { path = "../../crates/library" }
\ No newline at end of file +primrose-library = { path = "../../crates/library" } + +[[bench]] +name = "do_stuff" +harness = false
\ No newline at end of file diff --git a/src/tests/example_stack/benches/do_stuff.rs b/src/tests/example_stack/benches/do_stuff.rs new file mode 100644 index 0000000..69d50d5 --- /dev/null +++ b/src/tests/example_stack/benches/do_stuff.rs @@ -0,0 +1,6 @@ +fn main() { + // TODO: some actual benchmarking, not just a random loop + for _ in 0..20 { + example_stack::do_something(); + } +} diff --git a/src/tests/example_stack/src/main.rs b/src/tests/example_stack/src/lib.rs index d36e683..d8e95f3 100644 --- a/src/tests/example_stack/src/main.rs +++ b/src/tests/example_stack/src/lib.rs @@ -1,7 +1,7 @@ mod types; use types::*; -fn main() { +pub fn do_something() { let mut c = StackCon::<u32>::default(); for x in 0..10 { c.insert(x); |