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

15
LINES

< > BotCompany Repo | #1010992 // onFileChange

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (10899L/60K).

1  
svoid onFileChange(double seconds, File file, long lastModificationSeen default modificationTime(file), Runnable r) {
2  
  doEvery_daemon(toMS(seconds), new Runnable {
3  
    long lastMod = lastModificationSeen;
4  
    
5  
    run {
6  
      long mod = modificationTime(file);
7  
      if (mod != lastMod) {
8  
        lastMod = mod;
9  
        call(r);
10  
      }
11  
    }
12  
  });
13  
  
14  
  call(r);
15  
}

Author comment

Began life as a copy of #1004395

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1010992
Snippet name: onFileChange
Eternal ID of this version: #1010992/5
Text MD5: 93ea3251732b00ce9f577f5461785d04
Transpilation MD5: 19c14fa51b549209b85a313596bb4bd7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2024-07-14 01:59:56
Source code size: 379 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 520 / 588
Version history: 4 change(s)
Referenced in: [show references]