当前位置: 首页 > 文档资料 > Perl 入门教程 >

times

优质
小牛编辑
114浏览
2023-12-01

描述 (Description)

此函数返回一个四元素列表,为当前进程及其子进程提供用户,系统,子系统和子系统时间。

语法 (Syntax)

以下是此函数的简单语法 -

times

返回值 (Return Value)

此函数返回ARRAY,($ usertime,$ systemtime,$ childsystem,$ childuser)

例子 (Example)

以下是显示其基本用法的示例代码 -

#!/usr/bin/perl -w
($usertime, $systemtime, $childsystem, $childuser) = times();
print("times() $usertime $systemtime $childsystem $childuser\n");

执行上述代码时,会产生以下结果 -

times() 0 0 0 0