# loop-raf

> loop requestAnimationFrame

Latest version **1.0.10** (published 2016-12-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install loop-raf
pnpm add loop-raf
yarn add loop-raf
bun add loop-raf
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2016-12-02 |
| First published | 2016-12-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yangjunhua |
| Maintainers | yangjunhua |
| Keywords | loop, raf, requestAnimationFrame |

## Links

- npm: https://www.npmjs.com/package/loop-raf
- npm.io page: https://npm.io/package/loop-raf

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 1.0.10 (latest) — 2016-12-02
- 1.0.9 — 2016-12-01
- 1.0.8 — 2016-12-01
- 1.0.7 — 2016-12-01

## README

##### Installation
    npm install loop-raf --save

##### Api
    require('loop-raf')(loopCallback);


##### Usage
    var loop_raf = require('loop-raf');
    var delta = 0, reqId;

    loop_raf((lastFrameDuration, requestId) => {
        reqId = requestId;
        delta++;
    });

    setTimeout(() => {
        /**
         *  测试结果
         *  1、在chrome浏览器结果为1秒60帧左右
         *  2、在firefox浏览器结果为1秒50帧左右
         */
        alert(`您的浏览器在1秒内大概运行了${delta}动画帧`);
        window.cancelAnimationFrame(reqId);
    }, 1000);

---
_Source: https://npm.io/package/loop-raf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
