#!/usr/bin/perl -sw use strict; use Benchmark; our $ITERATIONS ||= 1e7; timethese($ITERATIONS, { gmtime => sub { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime(time); }, localtime => sub { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); }, } ); __END__ $ perl 619744.pl Benchmark: timing 10000000 iterations of localtime, gmtime... localtime: 101 wallclock secs (51.07 usr + 45.89 sys = 96.96 CPU) @ 103135.31/s (n=10000000) gmtime: 62 wallclock secs (29.76 usr + 27.94 sys = 57.70 CPU) @ 173310.23/s (n=10000000)