File: timers

package info (click to toggle)
liblinux-fd-perl 0.017-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 716 kB
  • sloc: perl: 49; makefile: 8
file content (15 lines) | stat: -rw-r--r-- 380 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! perl

use 5.012;
use warnings;

use POSIX::RT::Clock;
use Linux::FD::Timer;

my %clocks = map { $_ => POSIX::RT::Clock->new($_) } POSIX::RT::Clock->get_clocks;
$clocks{per_process} = POSIX::RT::Clock->get_cpuclock(getppid) if POSIX::RT::Clock->can('get_cpuclock');

while (my ($name, $clock) = each %clocks) {
	say "$name: ", eval { Linux::FD::Timer->new($clock) } ? 1 : 0;
}