Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 38 lines (31 sloc) 0.692 kb

httpTime

A stream module to capture and output the amount of time of a http request.

Using streams, you can pipe the request through the start and stop streams to capture and log the time of the request.

Usage

var http = require('http'),
  ht = require('http-time');

http.createServer(function(req,res) {
  req
    .pipe(ht.start(req))
    .pipe(...)
    .pipe(ht.stop(req))
    .pipe(res);
}).listen(3000);

or with event-stream

var http = require('http'),
  es = require('event-stream'),
  ht = require('http-time');

http.createServer(function(req,res) {
  es.pipeline(
    req,
    ht.start(req),
    ...,
    ht.stop(req),
    res
  );
}).listen(3000);
Something went wrong with that request. Please try again.