Does CygWin and Windows Powershell return the approximate correct (real, user and sys) time for program, like the time command utility in Linux do?

-1

Can we calculate the (real, user and sys) time for the C program in Windows using Cygwin and Powershell, like we do in Linux using time command utility ?

Khushal Gupta

Posted 2019-05-04T11:03:22.870

Reputation: 1

Answers

0

PowerShell has a built in command that is similar to Bash's "time". It is called Measure-Command.

You can use it like this:

Measure-Command {echo ok}

The output will be:

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

COOL_IRON

Posted 2019-05-04T11:03:22.870

Reputation: 93

How to get (real, user and sys) time using this information. ? – Khushal Gupta – 2019-05-05T10:54:00.177

@KhushalGupta sorry, no idea about that – COOL_IRON – 2019-05-17T09:44:33.333