Skip to content

Instantly share code, notes, and snippets.

@hidek
Created September 8, 2011 02:48
Show Gist options
  • Select an option

  • Save hidek/1202484 to your computer and use it in GitHub Desktop.

Select an option

Save hidek/1202484 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Benchmark qw/cmpthese/;
use Math::Random::MT;
cmpthese(
10000000,
{
mt => sub {
Math::Random::MT::rand(1);
},
rand => sub {
rand(1);
},
}
);
---
(warning: too few iterations for a reliable count)
Rate mt rand
mt 1014199/s -- -96%
rand 25641026/s 2428% --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment