Or, assuming you’re using Node 0.8 or newer (which you should be):
var start = process.hrtime();
makeSoapCall(function (err) {
var duration = process.hrtime(start);
console.error("SOAP call took %s milliseconds", (duration[0] * 1e9 +
duration[1]) / 1e6);
});
In general, process.hrtime() will be much more accurate than new Date(). If
you want aggregated metrics for your HTTP / SOAP calls over time, look at
metrics-gathering agent like New Relic, AppDynamics / Nodetime, or
StrongLoop’s StrongOps. You could write all the code yourself, but as
someone who’s done it, it’s kind of a pain to do yourself, even if the
results are much more useful than a list of request times printed to stderr
/ stdout.
F
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/CAHG3qKo12Gjg3iPCnRSOafRxtP7Y_srmsgfdC2gXuNEwJUkSrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.