第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何測量Windows命令行上命令的執(zhí)行時間?

如何測量Windows命令行上命令的執(zhí)行時間?

BIG陽 2019-07-04 12:32:23
如何測量Windows命令行上命令的執(zhí)行時間?是否有內(nèi)置方式來測量Windows命令行上命令的執(zhí)行時間?
查看完整描述

3 回答

?
慕絲7291255

TA貢獻1859條經(jīng)驗 獲得超6個贊

如果使用的是Windows 2003(請注意,Windows Server 2008及更高版本不受支持),則可以使用Windows Server 2003資源工具包,該工具包包含顯示詳細執(zhí)行狀態(tài)的timeit.exe。下面是一個例子,為命令“timeit-?”計時:

C:\>timeit timeit -?

Invalid switch -?

Usage: TIMEIT [-f filename] [-a] [-c] [-i] [-d] [-s] [-t] [-k keyname | -r keyname] [-m mask] [commandline...]

where:        -f specifies the name of the database file where TIMEIT

                 keeps a history of previous timings.  Default is .\timeit.dat

              -k specifies the keyname to use for this timing run

              -r specifies the keyname to remove from the database.  If

                 keyname is followed by a comma and a number then it will

                 remove the slowest (positive number) or fastest (negative)

                 times for that keyname.

              -a specifies that timeit should display average of all timings

                 for the specified key.

              -i specifies to ignore non-zero return codes from program

              -d specifies to show detail for average

              -s specifies to suppress system wide counters

              -t specifies to tabular output

              -c specifies to force a resort of the data base

              -m specifies the processor affinity mask


Version Number:   Windows NT 5.2 (Build 3790)

Exit Time:        7:38 am, Wednesday, April 15 2009

Elapsed Time:     0:00:00.000

Process Time:     0:00:00.015

System Calls:     731

Context Switches: 299

Page Faults:      515

Bytes Read:       0

Bytes Written:    0

Bytes Other:      298

您可以在Windows 2003資源工具包中獲取TimeIt。下載這里.


查看完整回答
反對 回復 2019-07-04
?
慕妹3146593

TA貢獻1820條經(jīng)驗 獲得超9個贊

或者,WindowsPowerShell有一個內(nèi)置命令,類似于Bash的“time”命令。它被稱為“測量命令”。您必須確保PowerShell安裝在運行它的機器上。

示例輸入:

Measure-Command {echo hi}

示例輸出:

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 0
Ticks             : 1318
TotalDays         : 1.52546296296296E-09
TotalHours        : 3.66111111111111E-08
TotalMinutes      : 2.19666666666667E-06
TotalSeconds      : 0.0001318
TotalMilliseconds : 0.1318


查看完整回答
反對 回復 2019-07-04
?
POPMUISE

TA貢獻1765條經(jīng)驗 獲得超5個贊

如果你想

  1. 以(hh:mm:ss.ff格式)將執(zhí)行時間降低到每秒的百分之一秒
  2. 不需要下載和安裝資源包
  3. 看起來像個大書呆子(誰不喜歡)

嘗試將以下腳本復制到一個新的批處理文件中(例如,時間蝙蝠):

@echo off
@setlocal

set start=%time%

:: Runs your command
cmd /c %*

set end=%time%
set options="tokens=1-4 delims=:.,"
for /f %options% %%a in ("%start%") do set start_h=%%a&set /a start_m=100%%b %% 100&set /a start_s=100%%c %% 100&set /a start_ms=100%%d %% 100
for /f %options% %%a in ("%end%") do set end_h=%%a&set /a end_m=100%%b %% 100&set /a end_s=100%%c %% 100&set /a end_ms=100%%d %% 100

set /a hours=%end_h%-%start_h%
set /a mins=%end_m%-%start_m%
set /a secs=%end_s%-%start_s%
set /a ms=%end_ms%-%start_ms%
if %ms% lss 0 set /a secs = %secs% - 1 & set /a ms = 100%ms%
if %secs% lss 0 set /a mins = %mins% - 1 & set /a secs = 60%secs%
if %mins% lss 0 set /a hours = %hours% - 1 & set /a mins = 60%mins%
if %hours% lss 0 set /a hours = 24%hours%
if 1%ms% lss 100 set ms=0%ms%

:: Mission accomplished
set /a totalsecs = %hours%*3600 + %mins%*60 + %secs%
echo command took %hours%:%mins%:%secs%.%ms% (%totalsecs%.%ms%s total)

使用

如果將timecmd.bat放在路徑中的目錄中,您可以在以下任何地方調(diào)用它:

timecmd [your command]

例如:

C:\>timecmd pause
Press any key to continue . . .
command took 0:0:1.18

如果要執(zhí)行輸出重定向,可以引用如下命令:

timecmd "dir c:\windows /s > nul"

這應該處理從前到午夜后運行的命令,但是如果命令運行了24小時或更長時間,輸出將是錯誤的。


查看完整回答
反對 回復 2019-07-04
  • 3 回答
  • 0 關(guān)注
  • 2336 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號