CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2006

    Javascript-Like Time Function

    How do I get a javascript-like output in seconds, from PHP? I want to track the amount of time it takes to pass all the data from server to client.

    Consider this code.
    var Now = new Date().getTime();
    document.write(new Date().getTime() - Now);
    I want it like this.
            echo "var _requestTime = " .  ???? . ";";
        var RequestTime = new Date().getTime() - _requestTime;
    Help me fill in the blanks.

  2. #2
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002

    Re: Javascript-Like Time Function

    You can detect how long your page takes by checking microtime() at the beginning and ending of your PHP page. However, you cannot account for the time that the client might take to render the CSS or HTML.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.