4

I hope to write a front-end monitoring utility to record server response time and content downloading time for API calls.

Using XHR, readyState 3 (LOADING) indicating downloading begins.

How can I get similar information from fetch() API?

Yishu Fang
  • 9,448
  • 21
  • 65
  • 102

1 Answers1

2

You can use PerformanceObserver() Count console.log objects and Performance. You can also utilize EventSource see How to read and echo file size of uploaded file being written at server in real time without blocking at both server and client?

guest271314
  • 1
  • 15
  • 104
  • 177