# ric.js **Repository Path**: mirrors_alsotang/ric.js ## Basic Information - **Project Name**: ric.js - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-11-23 - **Last Updated**: 2026-09-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## intro **[requestIdleCallback](https://developers.google.com/web/updates/2015/08/27/using-requestidlecallback)** experiment Execute heavy computing work, but do not block the browser. ## example without `ric`, and block ```js var max = 1000000000; var count = 0; while (count < max) { count++; } document.querySelector('.result').innerHTML = count; ``` with `ric`, and not block ```js var max = 1000000000; var count = 0; ric(function heavyWork() { count++ if (count % 1000000 === 0) { console.log('count is ' + count); } }, function isDone() { return count >= max; }, function afterDone() { document.querySelector('.result').innerHTML = count; }); ```