X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FBenchmark.pm;h=c472d58ffd64a6927486cf58b74e573d4d022128;hb=2c227d667bcf910e7fef2feea02fec7046f3cb13;hp=0ca7c59e4f67f6edb67928c1eeb5f1005e9a4af4;hpb=359218de2862c98ccfadd5880b5a17387de633db;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Benchmark.pm b/lib/Benchmark.pm index 0ca7c59..c472d58 100644 --- a/lib/Benchmark.pm +++ b/lib/Benchmark.pm @@ -485,19 +485,39 @@ sub usage { # The cache needs two branches: 's' for strings and 'c' for code. The # empty loop is different in these two cases. -sub clearcache ($) { +$_Usage{clearcache} = <<'USAGE'; +usage: clearcache($count); +USAGE + +sub clearcache { + die usage unless @_ == 1; delete $Cache{"$_[0]c"}; delete $Cache{"$_[0]s"}; } -sub clearallcache () { +$_Usage{clearallcache} = <<'USAGE'; +usage: clearallcache(); +USAGE + +sub clearallcache { + die usage if @_; %Cache = (); } -sub enablecache () { +$_Usage{enablecache} = <<'USAGE'; +usage: enablecache(); +USAGE + +sub enablecache { + die usage if @_; $Do_Cache = 1; } -sub disablecache () { +$_Usage{disablecache} = <<'USAGE'; +usage: disablecache(); +USAGE + +sub disablecache { + die usage if @_; $Do_Cache = 0; }