Smallest unit of time possible

Asked

Viewed 128 times

3

What would be the smallest unit of time that is currently possible to measure using ordinary computers?

As far as I can tell,.

1 answer

3


The fastest you can do is nanoseconds and the maximum resolution depends on the processor:

#include <sys/time.h>

int main()
{
   timespec ts;
   // clock_gettime(CLOCK_MONOTONIC, &ts); // Para FreeBSD
   clock_gettime(CLOCK_REALTIME, &ts); // Para Linux
}
  • The CLOCK_MONOTONIC is only for Freebsd or all BSD?

  • Friend, if the processor resolution is too large, it is possible that there is a dessynchronization between the computers even if "one day" adjusted at the same time?

  • 1

    @Patrick tested only on Freebsd, but a quick search indicated to me that it is also present on Netbsd and Openbsd but not on Mac OS X.

  • 1

    @Weslleycxsardinha depends a lot on how to adjust these computers, but not because the resolution changes what the minimum. And in larger units (minutes/seconds) the sync will remain. Now if you want to sync in nanoseconds, in this case there will be no permanent sync.

  • Such asynchrony can be predicted or is achieved through random effects?

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.