1. Perl
  2. Module
  3. here

Time::HiRes - Sleep in microseconds

Time::HiRes provides a highly accurate sleep.

You can use the usleep function to sleep in microseconds. sleep function has a minimum unit of 1 second, but you can use the usleep function to sleep in milliseconds or microseconds.

use Time::HiRes 'usleep';

usleep $microseconds;

The unit is microseconds, milliseconds are a thousand times that. For example, if you want to sleep for 0.1 seconds, write:

usleep(100 * 1000);

High - precision alarm, time, interval timer

In addition to the sleep function, Time::HiRes provides precision alarms, time and interval timers.

You can set an alarm or get a sense of time of 1 second or less in units of 1 second or less.

See the Time::HiRes documentation for more information.

Related Informatrion