當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Perl times用法及代碼示例


描述

該函數返回一個 four-element 列表,給出當前進程及其子進程的用戶、係統、子進程和子係統時間。

用法

以下是此函數的簡單語法 âˆ'

times

返回值

此函數返回數組,($usertime, $systemtime, $childsystem, $childuser)

示例

以下是顯示其基本用法的示例代碼 -

#!/usr/bin/perl -w

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

當上麵的代碼被執行時,它會產生下麵的結果——

times() 0 0 0 0

相關用法


注:本文由純淨天空篩選整理自 Perl times Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。