1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add benchmarks to create Time instances

This commit is contained in:
Nobuyoshi Nakada 2021-08-23 09:57:02 +09:00
parent e802587433
commit 11fd3fec53
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 12 additions and 0 deletions

4
benchmark/time_new.yml Normal file
View file

@ -0,0 +1,4 @@
benchmark:
- 'Time.new(2021)'
- 'Time.new(2021, 8, 22)'
- 'Time.new(2021, 8, 22, in: "+09:00")'

8
benchmark/time_parse.yml Normal file
View file

@ -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)