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

Posted on 2014-08-28
Last Modified: 2014-08-30
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

Question by:rwniceing
    LVL 37

    Accepted Solution

    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
    LVL 1

    Author Comment

    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
    LVL 37

    Assisted Solution

    by:Gerwin Jansen
    You should be able to do that using powershell:

    Measure-Command {php mytesting.php}
    LVL 1

    Author Closing Comment

    Thanks for your reply

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Wish Marketing would stop bothering you?

    Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

    I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
    The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
    The viewer will learn how to download, install and use CrashPlan from on Windows 7. Open your browser and go to Click get started, it’s free then Click the Download CrashPlan button: Click save in Internet Explorer, the…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now