Skip to content

Timestamps in nanoseconds #2

@aexklon

Description

@aexklon

I'm submitting a

  • feature request

Checklist

  • Searched both open and closed issues for duplicates of this issue
  • Title adequately and concisely reflects the feature or the bug

Information

sympact@0.0.3

The Problem

Timestamps are in ms (milliseconds). So, under certain circumstances, the difference between end and start is always zero ms. E.g: when profiling code that do not require long times to execute

Suggested solution

I would like to suggest timestamps in ns (nanoseconds). That could be achieved by replacing Date.now() for process.hrtime() in ./lib/profile.js. That would also require parsing the hrtime format with a function like this one:

function parseTime(hrtime) {
  return (hrtime[0] * 1e9) + hrtime[1]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions