Marky is a very small JavaScript library for measuring execution time with high-resolution browser and Node.js timing APIs. It wraps performance.mark() and performance.measure() behind a simple start-and-stop interface. Recorded measurements appear as standard Performance Timeline entries, allowing browser developer tools and compatible profiling software to visualize them. When the User Timing API is unavailable, Marky falls back to performance.now(), Date.now(), or process.hrtime() depending on the environment. Applications can retrieve all recorded measurement entries in chronological order. Stored marks and measurements can also be cleared programmatically. Its tiny footprint makes it useful for adding precise instrumentation without adopting a larger performance-monitoring framework.
Features
- High-resolution JavaScript timing
- User Timing API integration
- Browser and Node.js support
- Automatic timing API fallbacks
- Performance entry retrieval
- Programmatic measurement cleanup