summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-08-23 09:57:02 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-12 18:44:53 +0900
commit11fd3fec534bb626e717a0628a0cf6d6252a0ff4 (patch)
treeefb9e1f709d9a676f88402ce466b87d1ab8cd67a /benchmark
parente8025874334fa583fc77ed2ccc32ee78c2519a2c (diff)
Add benchmarks to create Time instances
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/time_new.yml4
-rw-r--r--benchmark/time_parse.yml8
2 files changed, 12 insertions, 0 deletions
diff --git a/benchmark/time_new.yml b/benchmark/time_new.yml
new file mode 100644
index 0000000000..5947dd3a41
--- /dev/null
+++ b/benchmark/time_new.yml
@@ -0,0 +1,4 @@
+benchmark:
+ - 'Time.new(2021)'
+ - 'Time.new(2021, 8, 22)'
+ - 'Time.new(2021, 8, 22, in: "+09:00")'
diff --git a/benchmark/time_parse.yml b/benchmark/time_parse.yml
new file mode 100644
index 0000000000..a6d6948b9c
--- /dev/null
+++ b/benchmark/time_parse.yml
@@ -0,0 +1,8 @@
+prelude: |
+ require 'time'
+ inspect = "2021-08-23 09:57:02 +0900"
+ iso8601 = "2021-08-23T09:57:02+09:00"
+benchmark:
+ - Time.iso8601(iso8601)
+ - Time.parse(iso8601)
+ - Time.parse(inspect)