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).

1  
!752
2  
3  
p {
4  
  Thread t = new Thread(r {
5  
    while licensed {
6  
      limitCPU(10);
7  
    }
8  
  }, "Burn 10%");
9  
  t.start();
10  
  
11  
  while licensed {
12  
    sleepSeconds(1);
13  
    limitCPU_Data data = limitCPU_data.get(t);
14  
    print(data.sleepTime + " / " + data.calcTime
15  
      + " = " + formatDouble(((double) data.calcTime)/data.sleepTime,
16  
        2));
17  
  }
18  
}

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: 548 / 583
Referenced in: [show references]