1

I noticed usleep() that can do something after a peroid of time. But I want this in a way that I have execute time, So to achive this with usleep() I need calculate the microseconds from now to the specific time.

For example: Now is 18:00:00.000 and I need to execute some tasks at 18:15:00.000 with a high accuracy like milliseconds or microseconds...

Any other good idea to do this OR how to calculate the difference between now and that time?

Sina
  • 53
  • 6

1 Answers1

0

Citing from this answer

The right answer is that it is not possible to have a millisecond precision on date/time functions in PHP. The precision of Unix Epoc based functions is only of 1k milliseconds, aka second :)

So you cannot achieve milliseconds/microseconds accuracy in PHP

aaandri98
  • 585
  • 4
  • 18