NAME

Time::Elapsed - Displays the elapsed time as a human readable string.

SYNOPSIS

use Time::Elapsed qw( elapsed );
$t = 1868401;
print elapsed( $t );

prints:

21 days, 15 hours and 1 second

If you set the language to turkish:

print elapsed( $t, 'TR' );

prints:

21 gün, 15 saat ve 1 saniye

DESCRIPTION

This module transforms the elapsed seconds into a human readable string.

FUNCTIONS

elapsed SECONDS [, LANG, TEMPLATE]

SECONDS must be a positive number representing the elapsed seconds. If it is absent, 0 (zero) will be used, but the returned value will be undef.

The optional argument LANG represents the language to use when converting the data to a string. Currently only english (EN) and turkish (TR) are supported. However, the language section is really a standalone module in the Time::Elapsed::Lang:: namespace, so it is possible to extend the language support on your own.

The optional argument TEMPLATE can alter the generated string' s format. It must be a HASHref with several keys. This option is currently not documented.

SEE ALSO

PTools::Time::Elapsed.

CAVEATS

This module' s source file is UTF-8 encoded (without a BOM) and it returns UTF-8 values whenever possible.

Currently, the module won't work with any perl older than 5.6 because of the UTF-8 encoding and the usage of utf8 pragma. However, the pragma limitation can be by-passed with a %INC trick under 5.005_04 (tested) and can be used with english language (default behavior), but any other language will probably need unicode support.

AUTHOR

Burak Gürsoy, <burak@cpan.org>

COPYRIGHT

Copyright 2007 Burak Gürsoy. All rights reserved.

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.