-3

I am beginner and tried to make quiz when the quiz over the I inserted $date=date(Y-m-d) in database. My question is how can I calculate time taken us this Please help to fix this

$date=date(Y-m-d);

John Conde
  • 217,595
  • 99
  • 455
  • 496
  • Your question is very unclear. What time do you want to calculate? Do you mean the amount of time between the current time and the date in the database, perhaps? Please clarify your wording. Use an example, if it helps, and specify the input values and expected output. – ADyson Sep 15 '21 at 14:04

1 Answers1

0

To measure the script runtime, take a timestamp at the begin and at the end of the script, the subtract the first from the second:

$t0 = microtime(true);
// do the work...
$t1 = microtime(true);

$t = ($t1 - $t0);
echo 'Script took '.number_format($t, 2).' seconds';
Honk der Hase
  • 2,459
  • 1
  • 14
  • 26