Skip to main content
Share Your Experience: Take the 2024 Developer Survey
3 of 10
even better
Adám
  • 30.3k
  • 2
  • 122
  • 286

APL, 157 156 154 150 bytes

{∊(3⍕n)' '((b/s⊃' KMG')'sec','ond'/⍨~b←t≥M)'s'/⍨1≠n←t÷M*s←⌊(M←1E3)⍟t←{+/×/⍵⍴⍨2,⍨0.5×⍴⍵}⍎⍵~'yoseinaut'⊣y←10×a←10×⊃ya mh k←365 30 7×ay←24×h←60×m←60×s←1}

Must have ⎕IO←0, which is default in many APLs.

Do I have to explain it? If so, that will have to wait for next week.

Thanks to Luke for shaving off 4 bytes.

Adám
  • 30.3k
  • 2
  • 122
  • 286