use Benchmark; package Foo; sub bar { 1; } package main; timethese(1000000, { method => sub { Foo->bar(); }, func => sub { Foo::bar(); }, } );