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).

static <A> PreciselyTimed<A> returnPreciselyTimed_repeat(int n, IF0<A> f) {
  long time = nanos();
  A a = null;
  repeat n {
    a = f.get();
  }
  ret PreciselyTimed(a, nsToMS(doubleRatio(nanos()-time, n)));
}

Author comment

Began life as a copy of #1026094

download  show line numbers  debug dex   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

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: 13 / 25
Referenced in: [show references]

Formerly at http://tinybrain.de/1030260 & http://1030260.tinybrain.de