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

8
LINES

< > BotCompany Repo | #1030260 // returnPreciselyTimed_repeat - evaluate function n times and return PreciselyTimed<A>

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

Libraryless. Click here for Pure Java version (2708L/17K).

1  
static <A> PreciselyTimed<A> returnPreciselyTimed_repeat(int n, IF0<A> f) {
2  
  long time = nanos();
3  
  A a = null;
4  
  repeat n {
5  
    a = f.get();
6  
  }
7  
  ret PreciselyTimed(a, nsToMS(doubleRatio(nanos()-time, n)));
8  
}

Author comment

Began life as a copy of #1026094

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030260
Snippet name: returnPreciselyTimed_repeat - evaluate function n times and return PreciselyTimed<A>
Eternal ID of this version: #1030260/1
Text MD5: 8b2b82e9460157f74a59c4e4790751c3
Transpilation MD5: 1d413b9779f40721c94a3fc6fa72b271
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-21 11:32:01
Source code size: 218 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 101 / 163
Referenced in: [show references]