Skip to content

Commit

Permalink
Added deprecated notes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicjansma committed Feb 17, 2017
1 parent 21e315d commit d9e8c3d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions request.js
Expand Up @@ -435,6 +435,8 @@ Request.prototype.init = function (options) {

if (options.time) {
self.timing = true

// NOTE: elapsedTime is deprecated in favor of .timings
self.elapsedTime = self.elapsedTime || 0
}

Expand Down Expand Up @@ -904,6 +906,8 @@ Request.prototype.onRequestResponse = function (response) {

// elapsedTime includes all redirects
self.elapsedTime += Math.round(self.timings.total)

// NOTE: elapsedTime is deprecated in favor of .timings
response.elapsedTime = self.elapsedTime

// timings is just for the final fetch
Expand Down Expand Up @@ -1047,6 +1051,8 @@ Request.prototype.onRequestResponse = function (response) {
responseContent.on('data', function (chunk) {
if (self.timing && !self.responseStarted) {
self.responseStartTime = (new Date()).getTime()

// NOTE: responseStartTime is deprecated in favor of .timings
response.responseStartTime = self.responseStartTime
}
self._destdata = true
Expand Down

0 comments on commit d9e8c3d

Please sign in to comment.