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

19
LINES

< > BotCompany Repo | #1001981 // "time {" (JavaX translator, time a code fragment and print result to System.out)

JavaX translator [tags: use-pretranspiled]

Transpiled version (280L) is out of date.

1  
// Syntax: time { doFunnyStuff(); }
2  
3  
!752
4  
5  
p {
6  
  L<S> tok = tokMainJava();
7  
  
8  
  tok = replaceKeywordBlock(tok,
9  
    // keyword to match
10  
    "time",
11  
    
12  
    // beginning of replacement block
13  
    "{ long __time_startTime = now(); try { ",
14  
    
15  
    // end of replacement block
16  
    "} finally { __time_startTime = now()-__time_startTime; saveTiming(__time_startTime); } }"); 
17  
    
18  
  saveMainJava(tok);
19  
}

Author comment

Began life as a copy of #1001897

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001981
Snippet name: "time {" (JavaX translator, time a code fragment and print result to System.out)
Eternal ID of this version: #1001981/1
Text MD5: 2e90b042ccae1731cf13b28b7943b049
Author: stefan
Category:
Type: JavaX translator
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-01-01 17:01:22
Source code size: 419 bytes / 19 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 626 / 757
Referenced in: [show references]