PHP microtime() drift, External NTP service

前端 未结 3 753
感情败类
感情败类 2021-01-16 13:38

I am looking for a solution for an issue on my cloud-hosted server where the result returned from microtime(true); is very accurate between calls within a few minutes of eac

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-16 14:18

    If you install NTP on your server you might get precision to within 10ms on your server. It depends on the network distance between your server and your reference and the network load on that route. If you make an HTTP request of some service you'll be lucky to get the time within 200ms. If you want your clients to have accurate time to within 10ms of reference they'll need NTP installed and then they might achieve your target. A local GPS reference will be the only reliable way for that accuracy.

提交回复
热议问题