my $start; my $end; &starttime; &stoptime; sub starttime{ $start = time; sleep 5; } sub stoptime{ $end = time; print $end - $start."\n"; }
Update: If you'd put "use strict;" in the beginning of your little snippet, Perl would warn you about this with: Global symbol "$start" requires explicit package name at test line 14.
In reply to Re: Current time as variable?
by b10m
in thread Current time as variable?
by einerwitzen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |