diff options
-rw-r--r-- | benchmark/time_now.yml | 3 | ||||
-rw-r--r-- | time.c | 7 | ||||
-rw-r--r-- | timev.rb | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/benchmark/time_now.yml b/benchmark/time_now.yml new file mode 100644 index 0000000000..f6d6a31489 --- /dev/null +++ b/benchmark/time_now.yml @@ -0,0 +1,3 @@ +benchmark: + - 'Time.now' + - 'Time.now(in: "+09:00")' @@ -1932,6 +1932,13 @@ time_init_now(rb_execution_context_t *ec, VALUE time, VALUE zone) } static VALUE +time_s_now(rb_execution_context_t *ec, VALUE klass, VALUE zone) +{ + VALUE t = time_s_alloc(klass); + return time_init_now(ec, t, zone); +} + +static VALUE time_set_utc_offset(VALUE time, VALUE off) { struct time_object *tobj; @@ -221,7 +221,7 @@ class Time # Parameter: # :include: doc/time/in.rdoc def self.now(in: nil) - new(in: Primitive.arg!(:in)) + Primitive.time_s_now(Primitive.arg!(:in)) end # _Time_ |