Skip to content

Commit

Permalink
feat: track in-flight network requests
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyu18 committed Oct 21, 2023
1 parent c99defd commit 4a7b982
Show file tree
Hide file tree
Showing 6 changed files with 4,557 additions and 48 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,37 @@ Easily measure performance metrics of time to interactive in JavaScript.
npm i @inchill/time-to-interactive
```

Or
or

```shell
yarn add @inchill/time-to-interactive
```

```js
import { onTTI } from '@inchill/time-to-interactive';
or

onTTI(res => console.log(res));
```shell
pnpm add @inchill/time-to-interactive
```

After installing it's simple to use:

```js
import { onTTI } from '@inchill/time-to-interactive';

onTTI(res => console.log(res)); // output =>

// {
// "name": "TTI",
// "value": 710.2000000001863,
// "rating": "good",
// "id": "v3-1697879873463-1156317372000"
// }
```

## Browser Support

The `time-to-interactive` code will run without error in all major browsers as well as Internet Explorer back to version 11. So, `onTTI` is currently only available in Chromium-based browsers (e.g. Chrome, Edge, Opera, Samsung Internet).

## License

[MIT](/LICENSE)
[MIT](/LICENSE)
Loading

0 comments on commit 4a7b982

Please sign in to comment.