lib/collection/response.js
function (timings) {
        // bail out if timing information is not provided
        if (!(timings && timings.offset)) {
            return;
        }

        var phases,
            offset = timings.offset;

        // REFER: https://github.com/postmanlabs/postman-request/blob/v2.88.1-postman.5/request.js#L996
        phases = {
            prepare: offset.request,
            wait: offset.socket - offset.request,
            dns: offset.lookup - offset.socket,
            tcp: offset.connect - offset.lookup,
            firstByte: offset.response - offset.connect,
            download: offset.end - offset.response,
            process: offset.done - offset.end,
            total: offset.done
        };

        if (offset.secureConnect) {
            phases.secureHandshake = offset.secureConnect - offset.connect;
            phases.firstByte = offset.response - offset.secureConnect;
        }

        return phases;
    }
function (timings) {
        // bail out if timing information is not provided
        if (!(timings && timings.offset)) {
            return;
        }

        var phases,
            offset = timings.offset;

        // REFER: https://github.com/postmanlabs/postman-request/blob/v2.88.1-postman.5/request.js#L996
        phases = {
            prepare: offset.request,
            wait: offset.socket - offset.request,
            dns: offset.lookup - offset.socket,
            tcp: offset.connect - offset.lookup,
            firstByte: offset.response - offset.connect,
            download: offset.end - offset.response,
            process: offset.done - offset.end,
            total: offset.done
        };

        if (offset.secureConnect) {
            phases.secureHandshake = offset.secureConnect - offset.connect;
            phases.firstByte = offset.response - offset.secureConnect;
        }

        return phases;
    }
function ( timings ) { // bail out if timing information is not provided if ( ! ( timings && timings . offset ) ) { return ; } var phases , offset = timings . offset ; // REFER: https://github.com/postmanlabs/postman-request/blob/v2.88.1-postman.5/request.js#L996 phases = { prepare : offset . request , wait : offset . socket - offset . request , dns : offset . lookup - offset . socket , tcp : offset . connect - offset . lookup , firstByte : offset . response - offset . connect , download : offset . end - offset . response , process : offset . done - offset . end , total : offset . done } ; if ( offset . secureConnect ) { phases . secureHandshake = offset . secureConnect - offset . connect ; phases . firstByte = offset . response - offset . secureConnect ; } return phases ; }
Returns the durations of each request phase in milliseconds

@typedef Response~timings
@property {Number} start - timestamp of the request sent from the client (in Unix Epoch milliseconds)
@property {Object} offset - event timestamps in millisecond resolution relative to start
@property {Number} offset.request - timestamp of the start of the request
@property {Number} offset.socket - timestamp when the socket is assigned to the request
@property {Number} offset.lookup - timestamp when the DNS has been resolved
@property {Number} offset.connect - timestamp when the server acknowledges the TCP connection
@property {Number} offset.secureConnect - timestamp when secure handshaking process is completed
@property {Number} offset.response -  timestamp when the first bytes are received from the server
@property {Number} offset.end - timestamp when the last bytes of the response are received
@property {Number} offset.done - timestamp when the response is received at the client

@note If there were redirects, the properties reflect the timings
of the final request in the redirect chain

@param {Response~timings} timings
@returns {Object}

@example Output
Request.timingPhases(timings);
{
prepare: Number,         // duration of request preparation
wait: Number,            // duration of socket initialization
dns: Number,             // duration of DNS lookup
tcp: Number,             // duration of TCP connection
secureHandshake: Number, // duration of secure handshake
firstByte: Number,       // duration of HTTP server response
download: Number,        // duration of HTTP download
process: Number,         // duration of response processing
total: Number            // duration entire HTTP round-trip
}

@note if there were redirects, the properties reflect the timings of the
final request in the redirect chain.
Returns the durations of each request phase in milliseconds