Libraryless. Click here for Pure Java version (83L/1K).
sS formatElapsedTimeWithAppropriateUnit(double seconds) { if (seconds >= 1) ret formatDouble(seconds, 3) + " s"; double ms = seconds*1000; if (ms >= 1) ret formatDouble(ms, 3) + " ms"; double us = ms*1000; if (us >= 1) ret formatDouble(us, 3) + " µs"; double ns = us*1000; ret formatDouble(ns, 3) + " ns"; }
Began life as a copy of #1010912
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1028976 |
Snippet name: | formatElapsedTimeWithAppropriateUnit [seconds down to nanoseconds] |
Eternal ID of this version: | #1028976/2 |
Text MD5: | ad223405fa3f57f9071dc45a4052cd93 |
Transpilation MD5: | 69fb0f3c8a570232b7bdd2fc22a04411 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-07-15 01:59:00 |
Source code size: | 330 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 246 / 348 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |