const axios = require("axios");
axios.get('url')
.then(response => {
console.log(response)
})
.catch(err => console.log(err))
How can i measure how much time did it take for website to return full page?
You can use performance.now() to measure the time between starting and finishing the request.
const axios = require("axios");
const { performance } = require('perf_hooks');
let time = performance.now();
axios.get('url')
.then(response => {
console.log(response)
console.log(`${(performance.now() - time) / 1000} seconds`);
})
.catch(err => console.log(err))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With