当前位置:首页 » Perl » perl times()函数

perl times()函数

perl times()函数例子,times()函数实例代码 - 返回给用户,系统,子和子系统时间为当前进程和其子四元素的列表。

语法

times


定义和用法

返回给用户,系统,子和子系统时间为当前进程和其子四元素的列表。

返回值

  • 数组, ($usertime, $systemtime, $childsystem, $childuser)

例子

在运行该程序根(root用户):

#!/usr/bin/perl -w

($usertime, $systemtime, $childsystem, $childuser) = times();
print("times() $usertime $systemtime $childsystem $childuser\n");

这将产生以下结果:

times() 0 0 0 0