method
usec
ruby latest stable - Class:
Time
usec()public
Returns the number of microseconds for time.
t = Time .now #=> 2007年11月19日 08:03:26 -0600 "%10.6f" % t.to_f #=> "1195481006.775195" t.usec #=> 775195
static VALUE
time_usec(VALUE time)
{
struct time_object *tobj;
wideval_t w, q, r;
GetTimeval(time, tobj);
w = wmod(tobj->timew, WINT2WV(TIME_SCALE));
wmuldivmod(w, WINT2FIXWV(1000000), WINT2FIXWV(TIME_SCALE), &q, &r);
return rb_to_int(w2v(q));
}