Skip to content

Instantly share code, notes, and snippets.

View nkanand4's full-sized avatar

Nitesh Kumar Anand nkanand4

  • Dell Inc
  • Round Rock, TX
View GitHub Profile
@nkanand4
nkanand4 / cpu-intensive.js
Created October 8, 2020 13:33 — forked from sorenlouv/cpu-intensive.js
A CPU intensive operation. Use to test imitate blocking code, test WebWorkers etc.
function mySlowFunction(baseNumber) {
console.time('mySlowFunction');
let result = 0;
for (var i = Math.pow(baseNumber, 7); i >= 0; i--) {
result += Math.atan(i) * Math.tan(i);
};
console.timeEnd('mySlowFunction');
}
mySlowFunction(8); // higher number => more iterations => slower
@nkanand4
nkanand4 / .jshintrc
Created February 6, 2014 18:39 — forked from haschek/.jshintrc
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true