Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodeimu

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodeimu - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

package.json
{
"name": "nodeimu",
"version": "2.0.0",
"version": "2.0.1",
"description": "Native addon for accessing IMU/pressure/humidity/temperature sensors using RTIMULib2",

@@ -5,0 +5,0 @@ "license": "BSD-2-Clause-FreeBSD",

@@ -17,2 +17,3 @@ # nodeimu

node test.js
node testSync.js
```

@@ -6,5 +6,10 @@ var util = require('util')

var num = 0;
var numStop = 100;
console.time("async");
var tic = new Date();
var callb = function (e, data) {
var toc = new Date();
if (e) {

@@ -14,2 +19,3 @@ console.log(e);

}
var sx = data.accel.x >= 0 ? ' ' : '';

@@ -22,7 +28,8 @@ var sy = data.accel.y >= 0 ? ' ' : '';

num++;
if (num == 100) {
if (num == numStop) {
console.timeEnd("async");
} else {
setTimeout(function() { IMU.getValue(callb); } , 50);
setTimeout(function() { tic = new Date(); IMU.getValue(callb); } , 50 - (toc - tic));
}

@@ -32,1 +39,3 @@ }

IMU.getValue(callb);

@@ -6,7 +6,10 @@ var util = require('util')

var num = 0;
var numStop = 100;
console.time("sync");
function dispAccel() {
function dispAccel() {
var tic = new Date();
var data = IMU.getValueSync();
var toc = new Date();
var sx = data.accel.x >= 0 ? ' ' : '';

@@ -19,9 +22,10 @@ var sy = data.accel.y >= 0 ? ' ' : '';

num++;
if (num == 100) {
clearInterval(intv);
if (num == numStop) {
console.timeEnd("sync");
} else {
setTimeout(dispAccel, 50 - (toc - tic));
}
}
var intv = setInterval(dispAccel, 50);
dispAccel();
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc