From 2a732947a65d1fe55e917425af10cee2e14b277a Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 16 Dec 2013 05:04:03 +0000 Subject: * process.c (make_clock_result): add :second as a unit for Process.clock_gettime. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'process.c') diff --git a/process.c b/process.c index b40cc25a90..5fc7ee1444 100644 --- a/process.c +++ b/process.c @@ -6825,6 +6825,9 @@ make_clock_result(struct timetick *ttp, numerators[num_numerators++] = 1000; return timetick2integer(ttp, numerators, num_numerators, denominators, num_denominators); } + else if (unit == ID2SYM(rb_intern("second"))) { + return timetick2integer(ttp, numerators, num_numerators, denominators, num_denominators); + } else if (unit == ID2SYM(rb_intern("float_microsecond"))) { numerators[num_numerators++] = 1000000; return timetick2dblnum(ttp, numerators, num_numerators, denominators, num_denominators); @@ -6958,6 +6961,7 @@ get_mach_timebase_info(void) * [:float_second] number of seconds as a float (default) * [:float_millisecond] number of milliseconds as a float * [:float_microsecond] number of microseconds as a float + * [:second] number of seconds as an integer * [:millisecond] number of milliseconds as an integer * [:microsecond] number of microseconds as an integer * [:nanosecond] number of nanoseconds as an integer -- cgit v1.2.3