CGI::A...Timing(3pm)

πŸ“¦
version 1.08+~cs2.4 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– CGI::Application::Plugin::DevPopup::Timing(3pm) β€” the manual, but make it make sense πŸ’–

okay so bestie, real talk: this is the CGI::Application::Plugin::DevPopup::Timing page from the Perl docs, and it's lowkey iconic. It's the lil plugin that shows you the timing info for your cgiapp stages β€” like, where did all the seconds go?? πŸ•°οΈβœ¨


✨ NAME ✨

CGI::Application::Plugin::DevPopup::Timing β€” it shows timing information about cgiapp stages. that's it, that's the whole vibe. β±οΈπŸ’…


πŸŽ€ VERSION πŸŽ€

version 1.08 β€” yes, we're on 1.08, no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

first you gotta load the plugins, like so:

use CGI::Application::Plugin::DevPopup;
use CGI::Application::Plugin::DevPopup::Timing;

then the rest of your application follows, and you just... live your life:

The rest of your application follows
...

aaand the output will look roughly like this β€” no guarantees it's pixel-perfect, but roughly:

Timings
Total runtime: 3.1178 sec.
Application started at: Thu Sep 22 02:55:35 2005

From                        To                              Time taken
-------------------------------------------------------------------------
init                        prerun                          0.107513 sec.
prerun                      before expensive operation      0.000371 sec.
before expensive operation  after expensive operation       3.006688 sec.
after expensive operation   load_tmpl(dp.html)              0.000379 sec.
load_tmpl(dp.html)          postrun                         0.002849 sec.

look at that table. it's giving receipts. πŸ’… the 3.006688 sec. between "before expensive operation" and "after expensive operation"? yeah that's the expensive operation being expensive. we love an honest queen. 😭πŸ”₯


🌸 ADD_TIMING 🌸

here's the fun part, bestie β€” you can add your own timing points inside your application by calling the hook at "devpopup_addtiming" with a short label. 🏷️✨

the table up there in the SYNOPSIS? yeah, that was created with exactly this code, character for character:

$self->call_hook('devpopup_addtiming', 'before expensive operation');
sleep 3;
$self->call_hook('devpopup_addtiming', 'after expensive operation');

see? sleep 3 β€” that's the whole reason that row is 3.006688 sec. and not 0.000371 sec.. mystery solved, detective πŸ•΅οΈβ€β™€οΈπŸ«Ά


πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, they're the main characters:

  • CGI::Application::Plugin::DevPopup
  • CGI::Application

πŸ’œ AUTHOR πŸ’œ

Rhesa Rozendaal, rhesa@cpan.org β€” shoutout to the author, fr fr πŸ«‘πŸ’–


πŸ› BUGS πŸ›

found a bug? want a feature? don't suffer in silence, bestie. please report any bugs or feature requests to bug-cgi-application-plugin-devpopup@rt.cpan.org, or through the web interface at:

<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Plugin-DevPopup>

and here's the deal, per the docs: "I will be notified, and then you'll automatically be notified of progress on your bug as I make changes." so like... you're in the loop. you're not just screaming into the void. πŸŒ€πŸ’€


Copyright 2005 Rhesa Rozendaal, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. artistic license behavior, slay πŸ§šβ€β™€οΈ


⚠️ real talk: those terms are "the same terms as Perl itself" β€” so when in doubt, go read Perl's own license rather than vibing your way through a legal question, okay? πŸ’…

✨ and that's the page, bestie ✨ β€” this was CGI::A...Timing(3pm), version-y vibes from perl v5.30.3, dated 2020-09-25. mwah, go time your stages πŸ’‹πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from