LoginSignup
12
9

More than 5 years have passed since last update.

cmdで簡単な処理時間計測

Posted at

cmdと言いつつpowershellを使う。

>powershell -C Measure-Command {echo 1}


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 0
Ticks             : 9193
TotalDays         : 1.06400462962963E-08
TotalHours        : 2.55361111111111E-07
TotalMinutes      : 1.53216666666667E-05
TotalSeconds      : 0.0009193
TotalMilliseconds : 0.9193

秒だけ。

>powershell -C (Measure-Command {test\main_test.bat}).TotalSeconds
8.6298945

psスクリプトの場合はExecutionPolicyの指定が必要なことがある。

>powershell -ExecutionPolicy RemoteSigned -C (Measure-Command {test\test.ps1}).TotalSeconds

ExecutionPolicyに関する参考記事
http://qiita.com/alchemist/items/e6706cd425f8f5e5032e

12
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
9