【发布时间】:2020-01-05 08:52:22
【问题描述】:
在 Node.js 中,process.hrtime 就是这样的对象
hrtime: { [Function: hrtime] bigint: [Function] },(在 pcores 对象中)
hrtime 可以被process.hrtime() 执行,并且有键bigint 作为由process.hrtime.bigint() 执行的函数。
我想知道hrtime 怎么可能同时是一个函数和一个对象。
我试图在对象中包含匿名函数,但失败了。
我该怎么做呢?
process {
title: 'node',
version: 'v10.16.3',
...
hrtime: { [Function: hrtime] bigint: [Function] },
...
}
【问题讨论】:
标签: node.js function object anonymous-function