Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mechelon authored Mar 18, 2024
1 parent ca2b163 commit 9cd316f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class Kernel extends HttpKernel
];
```

---

By default, the middleware measures only three things, to keep it as light-weight as possible:

- Bootstrap (time before the middleware gets called)
Expand All @@ -49,7 +51,7 @@ By default, the middleware measures only three things, to keep it as light-weigh

Once the package is successfully installed, you can see your timing information in the developer tools of your browser. Here's an example from Chrome:

![image](https://user-images.githubusercontent.com/40676515/73973252-d831a980-48e7-11ea-88fc-a606fd5b758a.png)
![CleanShot 2024-03-18 at 13 48 53@2x](https://github.com/beyondcode/laravel-server-timing/assets/26432041/adea40e4-5c34-4aee-9fb7-ad6bac40addc)

## Adding additional measurements

Expand All @@ -66,6 +68,9 @@ sleep(5);
ServerTiming::stop('Running expensive task');
```

![CleanShot 2024-03-18 at 13 51 56@2x](https://github.com/beyondcode/laravel-server-timing/assets/26432041/47e9e692-2bce-4449-a7ea-966fa4701cdb)


If you already know the exact time that you want to set as the measured time, you can use the `setDuration` method. The duration should be set as milliseconds:

```php
Expand Down

0 comments on commit 9cd316f

Please sign in to comment.