Socket
Book a DemoInstallSign in
Socket

js-performance

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-performance

A utility to measure js performance

latest
Source
npmnpm
Version
1.2.1
Version published
Maintainers
1
Created
Source

js-performance

A simple javascript utility to measure performance

Reason

Using console.time and console.timeEnd is tedious and may introduce extra time by invoking console.

Usage

  • time to mark the start point
  • timeEnd to mark the end point
  • log to log all mark message together
  • block to block js thread
import {time, timeEnd, log, block} from 'js-performance'

time('test')
block(5000)
timeEnd('test')

log() // test: 5000ms
  • measureCRP to measure the CRP time including interactive, domContentLoaded and complete
import {measureCRP} from 'js-performance'

measureCRP() // log your CRP time

Keywords

performance

FAQs

Package last updated on 26 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts