aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmarks/builtin-slice-append-int/pds.go
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-12-27 04:55:33 -0300
committerEuAndreh <eu@euandre.org>2024-12-27 04:55:33 -0300
commit2764d269764e5c34c0d94ea58a5544692762560d (patch)
treeb90c4bf1b9905566c00f9a7436c2cc79f1c8d843 /tests/benchmarks/builtin-slice-append-int/pds.go
parentAdd Makefile and move files to structured folders (diff)
downloadpds-2764d269764e5c34c0d94ea58a5544692762560d.tar.gz
pds-2764d269764e5c34c0d94ea58a5544692762560d.tar.xz
tests/pds.go: Move benchmarks and examples to separate test files
Diffstat (limited to 'tests/benchmarks/builtin-slice-append-int/pds.go')
-rw-r--r--tests/benchmarks/builtin-slice-append-int/pds.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/benchmarks/builtin-slice-append-int/pds.go b/tests/benchmarks/builtin-slice-append-int/pds.go
new file mode 100644
index 0000000..8e4ec9f
--- /dev/null
+++ b/tests/benchmarks/builtin-slice-append-int/pds.go
@@ -0,0 +1,23 @@
+package pds
+
+import (
+ "flag"
+)
+
+
+
+var nFlag = flag.Int(
+ "n",
+ 1_000_000,
+ "The number of iterations to execute",
+)
+
+func MainTest() {
+ flag.Parse()
+ n := *nFlag
+
+ a := []int{}
+ for i := 0; i < n; i++ {
+ a = append(a, i)
+ }
+}