loadtest
Advanced tools
Comparing version 0.1.15 to 0.1.16
@@ -106,3 +106,3 @@ 'use strict'; | ||
} | ||
var interval = Math.round(1000 / params.requestsPerSecond); | ||
var interval = 1000 / params.requestsPerSecond; | ||
requestTimer = new timing.HighResolutionTimer(interval, self.makeRequest); | ||
@@ -109,0 +109,0 @@ } |
@@ -357,4 +357,5 @@ 'use strict'; | ||
/** | ||
* A high resolution timer. | ||
* Initialize with milliseconds to wait and the callback to call. | ||
* A high resolution timer. Params: | ||
* - delayMs: miliseconds to wait before calls. Can be fractional. | ||
* - callback: function to call every time. | ||
*/ | ||
@@ -383,2 +384,7 @@ exports.HighResolutionTimer = function(delayMs, callback) | ||
var diff = (Date.now() - start) - counter * delayMs; | ||
var timeout = Math.floor(delayMs - diff); | ||
if (timeout <= 0) | ||
{ | ||
return delayed(); | ||
} | ||
setTimeout(delayed, delayMs - diff); | ||
@@ -385,0 +391,0 @@ } |
{ | ||
"name": "loadtest", | ||
"version": "0.1.15", | ||
"version": "0.1.16", | ||
"description": "Run load tests for your web application. Mostly ab-compatible interface, with an option to force requests per second. API for automated load testing.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/alexfernandez/loadtest", |
42871
1484