Libraryless. Click here for Pure Java version (7936L/44K).
sS renderElapsedTimePleasantly(long ms default lastTiming()) { double secs = toSeconds(ms); if (secs >= 1) ret formatDouble(secs, 3) + " s"; ret ms + " ms"; } sS renderElapsedTimePleasantly(Runnable r) { long time = sysNow(); r?.run(); ret renderElapsedTimePleasantly(sysNow()-time); } sS renderElapsedTimePleasantly(Duration d) { ret d == null ?: renderElapsedTimePleasantly(d.toMillis()); }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1013915 |
Snippet name: | renderElapsedTimePleasantly |
Eternal ID of this version: | #1013915/9 |
Text MD5: | 61e200bdcffe66b8043a6511a68ade79 |
Transpilation MD5: | 305d1ffe0aaeabb7f03848e04e10a8c9 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-05-01 19:09:01 |
Source code size: | 422 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 486 / 559 |
Version history: | 8 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1014777 - renderElapsedTimePleasantly_100ms #1032607 - renderElapsedSecondsPleasantly - goes down to nanoseconds if value is very small |