aboutsummaryrefslogtreecommitdiff
path: root/benches
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-06-07 02:46:14 -0700
committerFuwn <[email protected]>2021-06-07 02:46:14 -0700
commit7fdeda9791086b1285f4bb06f300bd9fa342b903 (patch)
tree2b7117191c9d7f75f0c3c3479dd71947d58973f7 /benches
parentdocs(cargo): change favicon and icon in generated docs (diff)
downloadwhirl-7fdeda9791086b1285f4bb06f300bd9fa342b903.tar.xz
whirl-7fdeda9791086b1285f4bb06f300bd9fa342b903.zip
test(whirl_common): create benchmarks
Diffstat (limited to 'benches')
-rw-r--r--benches/whirl_common.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/benches/whirl_common.rs b/benches/whirl_common.rs
new file mode 100644
index 0000000..dd4a945
--- /dev/null
+++ b/benches/whirl_common.rs
@@ -0,0 +1,15 @@
+// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective
+// SPDX-License-Identifier: GPL-3.0-only
+
+fn iai_benchmark_sort_vec_alphabetically() {
+ whirl_common::sort::vec_alphabetically(&mut vec!["a", "c", "d", "b"])
+}
+
+fn iai_benchmark_system_seconds_to_hrtime() -> String {
+ whirl_common::system::seconds_to_hrtime(1623058677)
+}
+
+iai::main!(
+ iai_benchmark_sort_vec_alphabetically,
+ iai_benchmark_system_seconds_to_hrtime
+);