The check_load_time function does the following:
- Writes the header for the report, including the current date and time, to the report file.
- Iterates over each URL in the
URLSarray. - For each URL, it uses
curlto measure the total time taken to load the page. Thecurlcommand is used with the following options:-o /dev/null: Discards the output.-s: Silent mode, which suppresses progress and error messages.-w '%{time_total}\n': Writes the total time, in seconds, that the request took to complete.
- Appends the loading time for each URL to the report file in a human-readable format.
- Prints a message indicating that the report has been saved.