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

14
LINES

< > BotCompany Repo | #1013136 // Test compact time stamps [OK, max 50 ms difference]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (938L/7K).

!7

p {
  long time = now();
  print("now: " + time);
  int compact = toCompactTimestamp(time);
  print("compact: " + compact);
  long back = fromCompactTimestamp(compact);
  long diff = back-time;
  print("back: " + back + " - diff: " + diff + " ms");
  assertBetween(-50, 50, diff);
  assertEquals(back, fromCompactTimestamp(toCompactTimestamp(back)));
  print("OK");
}

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: #1013136
Snippet name: Test compact time stamps [OK, max 50 ms difference]
Eternal ID of this version: #1013136/7
Text MD5: 65fc12c5690fd36cc010e89bf241cabb
Transpilation MD5: bfcd41d955bfb4bb39e6d79eea64e509
Author: stefan
Category: javax / calendar
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-26 05:33:27
Source code size: 384 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 301 / 712
Version history: 6 change(s)
Referenced in: [show references]