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

18
LINES

< > BotCompany Repo | #1014632 // Show RAM usage as gauge

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

Download Jar. Uses 8689K of libraries. Click here for Pure Java version (4737L/25K).

1  
!7
2  
3  
p {
4  
  final PGauge gauge1 = pMain(PGauge);
5  
  hideConsole();
6  
7  
  repeat with sleep 1 {
8  
    GlobalMemory m = oshi_systemMemory();
9  
    double percent = 100-percentRatio(m.getAvailable()-m.getSwapUsed(), m.getTotal());
10  
    S title = "RAM used";
11  
    
12  
    // scale to 180
13  
    //pgauge_showDiskSpace(gauge1, title, percent);
14  
    
15  
    // scale to 100
16  
    gauge1.setValue(percent, iround(percent) + "% of " + title);
17  
  }
18  
}

Author comment

Began life as a copy of #1014314

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014632
Snippet name: Show RAM usage as gauge
Eternal ID of this version: #1014632/7
Text MD5: 7d86e4fc28dfbc8ceddcc09eeaaaace6
Transpilation MD5: f70170dc03b293c41ba83b40ce57046d
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-30 14:48:08
Source code size: 433 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 531 / 1401
Version history: 6 change(s)
Referenced in: [show references]