Skip to content

Instantly share code, notes, and snippets.

@athomason
Created April 4, 2011 23:38
Show Gist options
  • Save athomason/902718 to your computer and use it in GitHub Desktop.
Save athomason/902718 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use feature ':5.10';
use Time::HiRes qw(time);
my $iterations = 1000000;
use Log::Syslog::Fast ':all';
my $lsf = Log::Syslog::Fast->new(LOG_UDP, "localhost", 1234, LOG_AUTH, LOG_INFO, 'sender', 'name');
my $start = time();
for(1..$iterations){
$lsf->send('this is an example log message!');
}
my $time = time() - $start;
printf("%d took %f2: %d per second\n", $iterations, $time, $iterations/$time);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment