aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmarks/builtin-slice-append-int/pds.go
diff options
context:
space:
mode:
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)
+ }
+}