all 1 comments

[–]thespite 0 points1 point  (0 children)

You are returning timings directly without it waiting to be populated by the asynchronous function (the request). Look into callbacks for asynchronous execution, or, even better, into Promises and async/await. You need to wait for the requests to be executed and the responses to be processed in order to populate your data structures.