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.

1  
static O time(O f) {
2  
  long time = sysNow();
3  
  O o = callF(f);
4  
  done2_always(str(f), time);
5  
  ret o;
6  
}
7  
8  
static <A> A time(F0<A> f) {
9  
  ret (A) time((O) f);
10  
}
11  
12  
static <A> A time(IF0<A> f) {
13  
  ret (A) time((O) f);
14  
}
15  
16  
static <A> A time(S msg, IF0<A> f) {
17  
  long time = sysNow();
18  
  A o = f.get();
19  
  done2_always(msg, time);
20  
  ret o;
21  
}
22  
23  
svoid time(S msg default str(f), Runnable f) {
24  
  time(msg, runnableToIF0(f));
25  
}

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: 587 / 679
Version history: 8 change(s)
Referenced in: [show references]