Dancer::Timer(3pm)

✨ NAME ✨

Dancer::Timer β€” it's literally a timer for Dancer, bestie πŸ’–


🌸 VERSION 🌸

version 1.3522 β€” that's the one, no cap


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's the whole vibe in code:

use Dancer::Timer;

my $timer = Dancer::Timer->new();
my $time  = $timer->tick;
print "[$time]: Doing something\n";

# (time passes)
$time = $timer->tick;
print "[$time]: Doing something else\n";

# (time passes)
$time = $timer->to_string;
print "[$time]: Doing another thing\n"

like... you make a timer, you tick it, time goes by, you tick again. slay πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Dancer::Timer hands Dancer a timing object so it can clock operations. it's giving "let me hold the stopwatch while you do your thing" 🫢

say you want logging that shows when each operation happened (like, at what time specifically) so you can figure out how long each one took β€” that way you know where to go hunting for possible bugs, or maybe just some unnecessary slowness that's lowkey ruining your whole day 😭

Dancer uses Dancer::Timer inside the facilities that want to give you this for free. and any plugin author out there? you are more than welcome to use it too. it's not gatekept, it's a community timer, periodt πŸ‘‘


πŸ’œ ATTRIBUTES πŸ’œ

start_time

holds onto the starting time of the timer. the default value is whenever the object gets created β€” it grabs that using gettimeofday from Time::HiRes. so yeah, your timer remembers its birthday πŸŽ‚βœ¨


🌈 METHODS 🌈

init

this one gets called when ->new() is called. it sets up the start_time attribute. it's the "getting ready" moment before the main character energy kicks in πŸ’…

tick

creates a tick in the timer and returns the interval between the start_time and now. that's it, that's the whole moment ⏱️

lowkey this is the one you'll be calling the most, just saying πŸ‘€

to_string

same as tick, just more expressive. it's the same energy, dressed cuter πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Dancer Core Developers

(icons, honestly 🫢)


This software is copyright (c) 2010 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. free as in freedom, bestie, go wild 🌈


and that's the page!! fr fr, this came from the User Contributed Perl Documentation for perl v5.40.1, dated 2026-05-05. go tick something cute, ily, bye πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from