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

25
LINES

< > BotCompany Repo | #1009019 // time - evaluate function and print timing

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

Transpiled version (2784L) is out of date.

static O time(O f) {
  long time = sysNow();
  O o = callF(f);
  done2_always(str(f), time);
  ret o;
}

static <A> A time(F0<A> f) {
  ret (A) time((O) f);
}

static <A> A time(IF0<A> f) {
  ret (A) time((O) f);
}

static <A> A time(S msg, IF0<A> f) {
  long time = sysNow();
  A o = f.get();
  done2_always(msg, time);
  ret o;
}

svoid time(S msg default str(f), Runnable f) {
  time(msg, runnableToIF0(f));
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1009019
Snippet name: time - evaluate function and print timing
Eternal ID of this version: #1009019/9
Text MD5: 0a1529a7432d71adf4b86ce6bbe1db34
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-29 05:30:29
Source code size: 436 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 492 / 573
Version history: 8 change(s)
Referenced in: [show references]