- PowerShell 教程
- PowerShell - 主頁
- PowerShell - 概覽
- PowerShell - 環境設定
- PowerShell - Cmdlet
- PowerShell - 檔案和資料夾
- PowerShell - 日期和計時器
- PowerShell - 檔案 I/O
- PowerShell - 高階 Cmdlet
- PowerShell - 指令碼
- PowerShell - 特殊變數
- PowerShell - 運算子
- PowerShell - 迴圈
- PowerShell - 條件
- PowerShell - 陣列
- PowerShell - 雜湊表
- PowerShell - 正則表示式
- PowerShell - 撇號
- PowerShell - 括號
- PowerShell - 別名
- PowerShell 實用資源
- PowerShell - 速查指南
- PowerShell - 實用資源
- PowerShell - 討論
PowerShell - Measure-Command Cmdlet
Cmdlet
Measure-Command Cmdlet 用於測量指令碼或命令所用的時間。
在這些示例中,我們將看到 Measure-Command Cmdlet 的實際應用。
示例
在此示例中,我們將展示如何測量 Get-EventLog 命令在 PowerShell 事件日誌中記錄事件所用的時間。
Measure-Command { Get-EventLog "Windows PowerShell" }
輸出
Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 50 Ticks : 506776 TotalDays : 5.86546296296296E-07 TotalHours : 1.40771111111111E-05 TotalMinutes : 0.000844626666666667 TotalSeconds : 0.0506776 TotalMilliseconds : 50.6776
powershell_advanced_cmdlets.htm
廣告