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

23
LINES

< > BotCompany Repo | #1016235 // Swap Count [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 5404K of libraries. Click here for Pure Java version (14450L/99K).

!7

sclass SwapCount extends DynBigNumber {
  transient long[] startValues;
  
  void start {
    super.start();
    setDescription("SWAPPED PAGES");
    GlobalMemory mem = oshi_systemMemory();
    startValues = new long[] { mem.getSwapPagesIn(), mem.getSwapPagesOut() };
    ownTimer(doEveryAndNow(1000, r actualUpdate));
  }
  
  void actualUpdate {
    temp enter();
    //time2 { // It's like 1 ms
      GlobalMemory mem = oshi_systemMemory();
      long in = mem.getSwapPagesIn()-startValues[0];
      long out = mem.getSwapPagesOut()-startValues[1];
    //}
    setValue(in + " IN " + out + " OUT");
  }
}

Author comment

Began life as a copy of #1016151

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: #1016235
Snippet name: Swap Count [Dyn Module]
Eternal ID of this version: #1016235/11
Text MD5: 3bcfc591532500b6d56c66c2129bf3d5
Transpilation MD5: 426a51d07a1cdfb02d6bf1c27a952795
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-12 16:19:00
Source code size: 633 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 457 / 1618
Version history: 10 change(s)
Referenced in: