I have a PHP script that uses an API. Sometimes the API can be fast, sometimes it’s slow. Is there a way to check if execution time of the get_contents(); is above ex. 2 seconds?
If it goes over this amount i want the included script to stop, and execute the original file.
Ex:
<?php
include("file.php"); //if more than 2 sec, continue
echo "Hello world";
?>