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

speedometer

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

speedometer - npm Package Compare versions

Comparing version 0.1.4 to 1.0.0

16

index.js
var tick = 1
var maxTick = 65535
var resolution = 4
var inc = function() {
var inc = function () {
tick = (tick + 1) & maxTick

@@ -11,9 +11,9 @@ }

module.exports = function(seconds) {
module.exports = function (seconds) {
var size = resolution * (seconds || 5)
var buffer = [0]
var pointer = 1
var last = (tick-1) & maxTick
var last = (tick - 1) & maxTick
return function(delta) {
return function (delta) {
var dist = (tick - last) & maxTick

@@ -25,9 +25,9 @@ if (dist > size) dist = size

if (pointer === size) pointer = 0
buffer[pointer] = buffer[pointer === 0 ? size-1 : pointer-1]
buffer[pointer] = buffer[pointer === 0 ? size - 1 : pointer - 1]
pointer++
}
if (delta) buffer[pointer-1] += delta
if (delta) buffer[pointer - 1] += delta
var top = buffer[pointer-1]
var top = buffer[pointer - 1]
var btm = buffer.length < size ? 0 : buffer[pointer === size ? 0 : pointer]

@@ -37,2 +37,2 @@

}
}
}
{
"name": "speedometer",
"version": "0.1.4",
"version": "1.0.0",
"repository": "git://github.com/mafintosh/speedometer",
"description": "simple speed measurement in javascript",
"license": "MIT",
"keywords": [

@@ -7,0 +8,0 @@ "speed",

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