diff --git a/doc/guides/writing-and-running-benchmarks.md b/doc/guides/writing-and-running-benchmarks.md index b6f8984afff029..693107f4c22668 100644 --- a/doc/guides/writing-and-running-benchmarks.md +++ b/doc/guides/writing-and-running-benchmarks.md @@ -444,14 +444,14 @@ function main(conf) { const http = require('http'); const len = conf.kb * 1024; const chunk = Buffer.alloc(len, 'x'); - const server = http.createServer(function(req, res) { + const server = http.createServer((req, res) => { res.end(chunk); }); - server.listen(common.PORT, function() { + server.listen(common.PORT, () => { bench.http({ connections: conf.connections, - }, function() { + }, () => { server.close(); }); });