bitburner-src/doc/source/netscript/basicfunctions/tFormat.rst

18 lines
600 B
ReStructuredText
Raw Normal View History

2021-03-12 20:32:07 +01:00
tFormat() Netscript Function
============================
2021-05-31 23:34:23 +02:00
.. js:function:: tFormat(milliseconds[, milliPrecision=false])
2021-03-12 20:32:07 +01:00
:RAM cost: 0 GB
:param number milliseconds: Amount of milliseconds to format.
2021-05-31 23:34:23 +02:00
:param number milliPrecision: Display time with millisecond precision.
2021-03-12 20:32:07 +01:00
:returns: milliseconds in the "D M H S" format
Example:
.. code-block:: javascript
2021-05-31 23:34:23 +02:00
tFormat(3000); // returns: "3 seconds"
tFormat(10000000); // returns: "2 hours 46 minutes 40 seconds"
tFormat(10000023, true); // returns: "2 hours 46 minutes 40.023 seconds"