From e78b9530ef707191961bfec0b05fe3843ee4119d Mon Sep 17 00:00:00 2001 From: hjp Date: Tue, 5 Jul 2016 19:55:43 +0000 Subject: [PATCH] Add script to hog cpu for given time --- hogs/cpuhogt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 hogs/cpuhogt diff --git a/hogs/cpuhogt b/hogs/cpuhogt new file mode 100755 index 0000000..660ad5f --- /dev/null +++ b/hogs/cpuhogt @@ -0,0 +1,10 @@ +#!/usr/bin/perl +use v5.20; +use warnings; + +use Time::HiRes qw(time); +my $t0 = time; +for (;;) { + my $dt = time - $t0; + last if $dt > $ARGV[0]; +}