
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
time-logger
Advanced tools
Utility library for tracking and tallying function calls in browsers, Node, or Arangodb's Foxx
Utility library for tracking and tallying function calls in javascript
// in node
const TimeLogger = require('time-logger')
TimeLogger.start('timing-label')
// ... code that needs to be profiled
TimeLogger.end('timing-label')
TimeLogger.dump('timing-label')
TimeLogger.clear('timing-label')
The above will print out the average, min, max, and call count of the code wrapped by timing-label in the following format:
timing-label calls: 2 avg: 1532.5ms min: 1416ms max: 1649ms
Calling dump() and clear() with no arguments will print and clear all accumulated timing metrics
// override the log function
TimeLogger.log = (key, details) => console.log(key, details)
// log function gets called with data to dump
TimeLogger.dump('time-label')
A custom logging function can be added to transform or conditionally log the dumped timing data. The avg, tally, min, and max are available in the details object.
The most precise timing measurements available are used depending on the platform. In browsers, performance.now() is used to get timing data, in Node process.hrtime() is used, and in Arangodb's Foxx require('internal').time is used.
When a precision timing function is unavailable, Date.now() is used, which gives coarse, millisecond precision.
FAQs
Utility library for tracking and tallying function calls in browsers, Node, or Arangodb's Foxx
We found that time-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.