最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

如何测算Windows下命令执行的时间

业界 admin 14浏览 0评论

在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秒

参考

  1. 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秒

参考

  1. How do I measure execution time of a command on the Windows command line?
发布评论

评论列表 (0)

  1. 暂无评论