Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1004540 // Test limitCPU 2

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (295L/3K/9K).

!752

p {
  Thread t = new Thread(r {
    while licensed {
      limitCPU(10);
    }
  }, "Burn 10%");
  t.start();
  
  while licensed {
    sleepSeconds(1);
    limitCPU_Data data = limitCPU_data.get(t);
    print(data.sleepTime + " / " + data.calcTime
      + " = " + formatDouble(((double) data.calcTime)/data.sleepTime,
        2));
  }
}

Author comment

Began life as a copy of #1004536

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

-
Snippet ID: #1004540
Snippet name: Test limitCPU 2
Eternal ID of this version: #1004540/1
Text MD5: 1a0e73fdebe28a890ad509645c899a04
Transpilation MD5: a8ec9bf81dc6d9f31edc15dfc7f957e9
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-20 15:06:31
Source code size: 362 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 605 / 657
Referenced in: