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

17
LINES

< > BotCompany Repo | #1015967 // Try caching OSHI results (OK - i.e., you can't cache the process object)

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

Download Jar. Uses 8038K of libraries. Click here for Pure Java version (1201L/8K).

!7

p {
  OSProcess process = null;
  repeat 5 { time "oshi_operatingSystem" { oshi_operatingSystem(); }}
  repeat 5 { time "oshi_currentProcess" { process = oshi_currentProcess(); }}
  while licensed {
    time "getResidentSetSize" {
      long size = process.getResidentSetSize();
    }
    time "oshi_currentProcessResidentSize" {
      long actualSize = oshi_currentProcessResidentSize();
    }
    print ((size == actualSize? "OK" : "DIFF " + (actualSize-size)) + " - " + actualSize);
    sleepSeconds(3);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): cfunsshuasjs, mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1015967
Snippet name: Try caching OSHI results (OK - i.e., you can't cache the process object)
Eternal ID of this version: #1015967/9
Text MD5: 3c59ff831a32a885af2b3de3739c2b46
Transpilation MD5: b6a1f2d75240f833deb35439b1346034
Author: stefan
Category: javax / os
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): Yes
Created/modified: 2018-06-02 13:29:42
Source code size: 532 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 355 / 828
Version history: 8 change(s)
Referenced in: [show references]