Perl: Get microseconds since Unix epoch

I need to get system uptime with a higher resolution that just one second. This is the function I came up with to return uptime in microseconds.

sub micros {
    require Time::HiRes;

    my @p   = Time::HiRes::gettimeofday();
    my $ret = ($p[0] * 1000000) + $p[1];

    return $ret;
}


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 3.22.79.165
To prevent spam please submit by clicking the kitten: