running time of the php script extracted in linux and window batch script

Dear Experts,

I have one php script which is running some simple testing code, and run it
as linux shell such as follows.

$ php mytesting.php

I know the code execution time is around 10 milli-second or 0.01 second , I know  I can add php function like microtime() function to get the code running time before and after.
But I just want to know how do  it in Linux script and window batch script with php mytesting.php command included ?

Please advise

Rwniceing
LVL 1
rwniceingAsked:
Who is Participating?
 
Gerwin Jansen, EE MVETopic Advisor Commented:
Is it that you want to know how long the command runs under Linux? You can 'time' any command in Linux like this:

time <command>

so in your case:

time php mytesting.php
0
 
rwniceingAuthor Commented:
Yes, it work on linux  output is

real  0m1.006s
user 0m0.575s
sys   0m0.016s

What is real, user,sys stand for. user is stand for the time running  php mytesting.php
sys is stand for running time command  itself ?

What is similar command for window 7 or batch script to extract the total execution time of "php mytesting.php" ?

Please advise
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
You should be able to do that using powershell:

Measure-Command {php mytesting.php}
0
 
rwniceingAuthor Commented:
Thanks for your reply
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.