landvex: Fixar och tester klara för alla komponenter
- Datafabrik: Dockerfile fix, agentorkestrering fungerar - Vision: Identify-modell, FAISS, OCR alla testade - API: Alla 7 integrationstester passerade - Upplösare: Entitetsupplösning verifierad
This commit is contained in:
+2
@@ -0,0 +1,2 @@
|
||||
.idea
|
||||
node_modules
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
# NanoTime
|
||||
|
||||
Gets the current time in nanoseconds or microseconds.
|
||||
|
||||
In node.js you can get high resolution time with `process.hrtime()`, but it is from an unknown relative time, not epoch. So this library helps that by calculating the difference and adding it to the current time.
|
||||
|
||||
## Usage
|
||||
|
||||
Since javascript can't hold a nanosecond as an INT safely (_Number.MAX_SAFE_INTEGER_), we return a string instead.
|
||||
|
||||
```js
|
||||
const now = require('nano-time');
|
||||
|
||||
now(); // '1476742925219947761' (returns a string)
|
||||
now.micro(); // '1476742921398373'
|
||||
now.microseconds(); // alias for now.micro();
|
||||
```
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
const BigInt = require('big-integer');
|
||||
|
||||
const loadNs = process.hrtime();
|
||||
const loadMs = new Date().getTime();
|
||||
|
||||
function nanoseconds() {
|
||||
let diffNs = process.hrtime(loadNs);
|
||||
return BigInt(loadMs).times(1e6).add(BigInt(diffNs[0]).times(1e9).plus(diffNs[1])).toString();
|
||||
}
|
||||
|
||||
function microseconds() {
|
||||
return BigInt(nanoseconds()).divide(1e3).toString();
|
||||
}
|
||||
|
||||
module.exports = nanoseconds;
|
||||
module.exports.microseconds = module.exports.micro = microseconds;
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "nano-time",
|
||||
"version": "1.0.0",
|
||||
"description": "Current Time in Nanoseconds",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sazze/node-nanotime.git"
|
||||
},
|
||||
"keywords": [
|
||||
"nanoseconds",
|
||||
"time",
|
||||
"date",
|
||||
"current",
|
||||
"time",
|
||||
"microseconds"
|
||||
],
|
||||
"author": "Kevin Smithson <ksmithson@sazze.com>",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/sazze/node-nanotime/issues"
|
||||
},
|
||||
"homepage": "https://github.com/sazze/node-nanotime#readme",
|
||||
"dependencies": {
|
||||
"big-integer": "^1.6.16"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user