static int burnCPUForNSeconds_dummy; // returns some sort of speed measure static int burnCPUForNSeconds(double seconds) { int n = 1, iterations = 0; long endTime = sysTimeInNSeconds(seconds); while (licensed() && sysNow() < endTime) { ++iterations; repeat 100000 { n += n*2; } } burnCPUForNSeconds_dummy = n; ret iround(iterations/seconds); }
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1018524 |
Snippet name: | burnCPUForNSeconds |
Eternal ID of this version: | #1018524/6 |
Text MD5: | 498f375ad75766870f6d09b0ec0bec72 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-01-03 17:03:48 |
Source code size: | 376 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 290 / 366 |
Version history: | 5 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |