在PowerShell下,执行以下命令:
Measure-Command {echo hi | Out-Default}
注意如果没有指定Out-Default,则stdout的输出将不显示。
以下为一个命令的示例:
PS D:\vagrant-boxes\OracleDatabase\12.2.0.1> Measure-Command { vagrant up | Out-Default}
getting Proxy Configuration from Host...
Bringing machine 'oracle-12201-vagrant' up with 'virtualbox' provider...
==> oracle-12201-vagrant: Importing base box 'ol7-latest'...
...
oracle-12201-vagrant: INSTALLER: Created and enabled oracle-rdbms systemd's service
oracle-12201-vagrant: INSTALLER: setPassword.sh file setup
oracle-12201-vagrant: INSTALLER: Running user-defined post-setup scripts
oracle-12201-vagrant: INSTALLER: Done running user-defined post-setup scripts
oracle-12201-vagrant: ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: X9/SdE/TD1U=1
oracle-12201-vagrant: INSTALLER: Installation complete, database ready to use!
Days : 0
Hours : 0
Minutes : 22
Seconds : 21
Milliseconds : 331
Ticks : 13413319800
TotalDays : 0.0155246756944444
TotalHours : 0.372592216666667
TotalMinutes : 22.355533
TotalSeconds : 1341.33198
TotalMilliseconds : 1341331.98
输出显示安装单实例Oracle数据库12.2.0.1耗时22分钟21秒
参考
- How do I measure execution time of a command on the Windows command line?
在PowerShell下,执行以下命令:
Measure-Command {echo hi | Out-Default}
注意如果没有指定Out-Default,则stdout的输出将不显示。
以下为一个命令的示例:
PS D:\vagrant-boxes\OracleDatabase\12.2.0.1> Measure-Command { vagrant up | Out-Default}
getting Proxy Configuration from Host...
Bringing machine 'oracle-12201-vagrant' up with 'virtualbox' provider...
==> oracle-12201-vagrant: Importing base box 'ol7-latest'...
...
oracle-12201-vagrant: INSTALLER: Created and enabled oracle-rdbms systemd's service
oracle-12201-vagrant: INSTALLER: setPassword.sh file setup
oracle-12201-vagrant: INSTALLER: Running user-defined post-setup scripts
oracle-12201-vagrant: INSTALLER: Done running user-defined post-setup scripts
oracle-12201-vagrant: ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: X9/SdE/TD1U=1
oracle-12201-vagrant: INSTALLER: Installation complete, database ready to use!
Days : 0
Hours : 0
Minutes : 22
Seconds : 21
Milliseconds : 331
Ticks : 13413319800
TotalDays : 0.0155246756944444
TotalHours : 0.372592216666667
TotalMinutes : 22.355533
TotalSeconds : 1341.33198
TotalMilliseconds : 1341331.98
输出显示安装单实例Oracle数据库12.2.0.1耗时22分钟21秒
参考
- How do I measure execution time of a command on the Windows command line?