
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
While working with CSS, HTML, and JavaScript, it's always important to take care of browser rendering in browser DevTools. To find issues with rendering, we are using "Timeline" with "JS Profile" and "Memory" consumption tracking. Those tools are great when you know about the existing problem.
During our development process, we are using FPS-meter, which gives a signal when "Long" frames occur. To see meter action, visit this link (in the left bottom corner). Play with sliders to see how different CSS effects may slow down the rendering process, blur
is the most "expensive" CSS3 filter.
This library works on mobile devices. It utilizes performance.now
to measure time frame and requestAnimationFrame
to measure rendered frames, both APIs are very efficient and have a minor impact (for correct FPS measurement).
Installation is not required, copy-paste script into browser' console:
<script type="text/javascript" src="https://raw.githubusercontent.com/veliovgroup/fps-meter/master/fps-meter-drop-in.min.js"></script>
Installation is available via NPM for your favorite build tool and Atmosphere for Meteor.js
npm i --save fps-m
meteor add ostrio:fps-meter
// require
const FPSMeter = require('fps-m');
// ES6 import:
import FPSMeter from 'fps-m';
import { FPSMeter } from 'meteor/ostrio:fps-meter';
(new FPSMeter({ui: true})).start();
Render, start, pause, and resume FPS Meter
new FPSMeter([opts])
opts
{Object}opts.ui
{Boolean} - Render small box with current FPS into body
, default: false
opts.reactive
{Boolean} - Store current FPS as reactive data source, default: false
// Quick start:
const fps = new FPSMeter({ui: true, reactive: false});
// fps.start();
// fps.stop();
FPSMeter#start()
— Use to start measuring FPS. If {ui: true}
small box with current FPS will be rendered into body
FPSMeter#stop()
— Use to stop measuring FPS. If {ui: true}
box with current FPS will be removed from body
FPSMeter#pause()
— Use to pause measuring FPS. If {ui: true}
box with current FPS will remain in body
FPSMeter#resume()
— Use to resume measuring FPSFPSMeter#toggle()
— Use to toggle (pause/resume) measuring FPSFPSMeter#isRunning
{Boolean} — true
if meter is running and false
when meter is on pause, stopped or has not started yetFPSMeter#template
{Blaze.View|undefined} — When {ui: true}
this property holds Blaze.View instance, otherwise its undefined
FPSMeter#element
{DOMElement|undefined} — When {ui: true}
this property holds DOMElement of FPSMeter UI element div
, otherwise its undefined
FPSMeter#fps
{Number|ReactiveVar} — When {reactive: false}
it holds a {Number} with current FPS. When {reactive: true}
it is an instance of {*ReactiveVar*}
. Use .get()
method to return current FPS. It's reactive data source, and can be used in template:const fps = new FPSMeter({ ui: true });
fps.start();
fps.element.addEventListener('click', fps.toggle.bind(fps), { passive: true, capture: false });
const fps = new FPSMeter({ui: false, reactive: true});
Template.currentFPS.helpers({
currentFPS() {
return fps.fps.get();
}
});
Template.currentFPS.events({
'click [data-start-fps]'(e) {
e.preventDefault();
fps.start();
return false;
},
'click [data-stop-fps]'(e) {
e.preventDefault();
fps.stop();
return false;
}
});
<template name="currentFPS">
<div>{{currentFPS}}</div>
<button data-start-fps>Start</button>
<button data-stop-fps>Stop</button>
</template>
FAQs
Efficient and accurate FPS meter, with minimalistic UI
The npm package fps-m receives a total of 6 weekly downloads. As such, fps-m popularity was classified as not popular.
We found that fps-m demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.