Skip to main content

Using StopWatch

Introduction

Provides a set of methods and properties that you can use to accurately measure elapsed time inside your code.

Installation

npm install @sapphire/stopwatch

Usage

// Import the Stopwatch classimport { Stopwatch } from '@sapphire/stopwatch';// Create a new Stopwatch (which also starts it immediately)const stopwatch = new Stopwatch();// run other task hereconsole.log(stopwatch.stop().toString());// 200ms