Skip to content

Instantly share code, notes, and snippets.

@rishabh-ink
Created July 30, 2018 23:57
Show Gist options
  • Save rishabh-ink/923b62f8db5418e1ff251c726ce39179 to your computer and use it in GitHub Desktop.
Save rishabh-ink/923b62f8db5418e1ff251c726ce39179 to your computer and use it in GitHub Desktop.
Libdefs for Node’s experimental (as of v10.7.x) core module, perf_hooks
// @flow
/**
* Libdefs for Node’s experimental (as of v10.7.x) core module, perf_hooks.
*
* TODO Work in progress. Add libdefs for other functions in this module.
*
* @see https://nodejs.org/api/perf_hooks.html
*/
declare module 'perf_hooks' {
declare export var performance: {
/**
* @see https://nodejs.org/api/perf_hooks.html#perf_hooks_performance_mark_name
*/
mark: (string) => void,
/**
* @see https://nodejs.org/api/perf_hooks.html#perf_hooks_performance_measure_name_startmark_endmark
*/
measure: (string, string, string) => void,
/**
* @see https://nodejs.org/api/perf_hooks.html#perf_hooks_performanceobserverentrylist_getentriesbyname_name_type
*/
getEntriesByName: (string, ?string) => Array<{
duration: number,
}>,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment