diff doc/api-molko-clock.rst @ 191:633a25df450e

molko-js: miscellaneous fixes While here, import sphinx as experimental documentation.
author David Demelier <markand@malikania.fr>
date Sat, 07 Nov 2020 15:40:34 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api-molko-clock.rst	Sat Nov 07 15:40:34 2020 +0100
@@ -0,0 +1,32 @@
+.. toctree::
+.. _api-molko-clock:
+
+Molko.Clock
+===========
+
+Keep track of elapsed time.
+
+Constructors
+------------
+
+.. js:function:: Molko.Clock()
+
+Create a new clock object and start collecting time from now. This function
+MUST be called as a constructor, not doing so will also raise an error.
+
+Methods
+-------
+
+.. js:method:: Molko.Clock.start()
+
+Reset the clock from now.
+
+Properties
+----------
+
+The following properties are available once an object has been constructed:
+
+.. js:attribute:: Molko.Clock.elapsed
+
+(Read-only) Number of milliseconds elapsed since construction of object or last
+call to start function.