Home
Quick start
Documentation
Forum
GitHub
Home
Quick start
Documentation
Forum
GitHub
  • Quick Start

    • Introduction
    • Why Phico
    • Installation
  • Example app

    • Scaffolding
    • Routes
    • Requests
    • Responses
    • Events
  • Phico

    • CLI
    • Config
    • Container
    • Filesystem
    • Logger
    • Middleware
    • Request
    • Response
    • Router
    • Support
    • View
  • Libraries

    • Authentication
    • Cache
    • CDN
    • Database
    • Http client
    • Locale
    • Mailer
    • Profiler
    • Query
    • Queue
    • Validation
    • Session
    • View
  • Works

    • Introduction

Profiler

Lightweight app timer and profiling middleware, provides timings in your browser developer console.

Installation

Using composer

composer require phico/profiler

Usage

Add the middleware to your application

// /app/middleware.php

$app->use[
    ...
    new \Phico\Profiler\ProfilerMiddleware,
    ...
];

Start a timer

$timer = $request->attr('timer');
$timer->start('account-action', 'You may add a description');

Stop a timer

$timer = $request->attr('timer');
$timer->stop('account-action');

Check the response timing pane in your browser developer console.

Last Updated:
Contributors: indgy
Prev
Mailer
Next
Query