Browse Source

handle time on linux

master 0.0.1
Zane C. B-H 2 years ago
parent
commit
256af82bbc
  1. 4
      Proc-ProcessTable-Match/Changes
  2. 4
      Proc-ProcessTable-Match/lib/Proc/ProcessTable/Match.pm
  3. 10
      Proc-ProcessTable-Match/lib/Proc/ProcessTable/Match/Time.pm

4
Proc-ProcessTable-Match/Changes

@ -1,5 +1,9 @@
Revision history for Proc-ProcessTable-Match
0.0.1 2019-08-26/20:45
- Handle time properly on linux now
by converting it to seconds.
0.0.0 2019-08-25/06:00
- Initial release.

4
Proc-ProcessTable-Match/lib/Proc/ProcessTable/Match.pm

@ -10,11 +10,11 @@ Proc::ProcessTable::Match - Matches a Proc::ProcessTable::Process against a stac
=head1 VERSION
Version 0.0.0
Version 0.0.1
=cut
our $VERSION = '0.0.0';
our $VERSION = '0.0.1';
=head1 SYNOPSIS

10
Proc-ProcessTable-Match/lib/Proc/ProcessTable/Match/Time.pm

@ -10,11 +10,11 @@ Proc::ProcessTable::Match::Time - Check if the user + system time of a process m
=head1 VERSION
Version 0.0.0
Version 0.0.1
=cut
our $VERSION = '0.0.0';
our $VERSION = '0.0.1';
=head1 SYNOPSIS
@ -41,7 +41,7 @@ our $VERSION = '0.0.0';
This intiates the object.
It takes a hash reference with one key. One key is required and
that is 'times', which is a array of time values to match.
that is 'times', which is a array of time values in seconds to match.
The Time values can be prefixed with the equalities below for doing
additional comparisons.
@ -129,6 +129,10 @@ sub match{
return 0;
}
if ( $^O =~ /^linux$/ ){
$proc_time=$proc_time/1000000;
}
# use while as foreach will reference the value
my $time_int=0;
while (defined( $self->{times}[$time_int] )){

Loading…
Cancel
Save