Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8307039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:26:59+00:00 2026-06-08T18:26:59+00:00

I have something like a microtime() function at the very start of my node.js

  • 0

I have something like a microtime() function at the very start of my node.js / express app.

function microtime (get_as_float) {
    // Returns either a string or a float containing the current time in seconds and microseconds  
    // 
    // version: 1109.2015
    // discuss at: http://phpjs.org/functions/microtime
    // +   original by: Paulo Freitas
    // *     example 1: timeStamp = microtime(true);
    // *     results 1: timeStamp > 1000000000 && timeStamp < 2000000000
    var now = new Date().getTime() / 1000;
    var s = parseInt(now, 10);

    return (get_as_float) ? now : (Math.round((now - s) * 1000) / 1000) + ' ' + s;
}

The code of the actual app looks something like this:

application.post('/', function(request, response) {
  t1 = microtime(true);
  //code
   //code
   response.send(something);
   console.log("Time elapsed: " + (microtime(true) - t1));
}

Time elapsed: 0.00599980354309082

My question is, does this mean that from the time a POST request hits the server to the time a response is sent out is give or take ~0.005s?

I’ve measured it client-side but my internet is pretty slow so I think there’s some lag that has nothing to do with the application itself. What’s a quick and easy way to check how quickly the requests are being processed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:27:01+00:00Added an answer on June 8, 2026 at 6:27 pm

    Shameless plug here. I’ve written an agent that tracks the time usage for every Express request.

    http://blog.notifymode.com/blog/2012/07/17/profiling-express-web-framwork-with-notifymode/

    In fact when I first started writing the agent, I took the same approach. But I soon realized that it is not accurate. My implementation tracks the time difference between request and the response by substituting the Express router. That allowed me to add tracker functions. Feel free to give it a try.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like this create function Answers_Index(@id int, @questionID int) returns int as
I have something like this: function showFunction () { // need position and place
I have something like this: Map<String, String> myMap = ...; for(String key : myMap.keySet())
I have something like the following: var myTimeout; function delayStuffUntil( when ){ if( myTimeout)
I have something like this in my Project#show view: ... <p> <b>Start date:</b> <%=
I have something like: $(document).ready(function() { var numberOfTables = 3; }); Is there anyway
I have something like this: <a href=# id=lol>LOL</a> <script type=text/javascript> $('#lol').click(function(){ $.get(<?php echo $host.'/index.php'?>,
I have something like that: <div style=width:100px;float:left>menu</div> <div style=float:left>content</div> both floats are neccesary. I
I have something like this: $.getJSON('/scripts/commons/theScriptDoTravelBackInTime.php',{ }, function(){ // etc.. etc... } }); Is
I have something like this: union MyBBox3D { struct { float m_fBox[6]; float m_fCenter[3];

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.