Converting MWorks time to wall-clock time

Christopher Stawarz's Avatar

Christopher Stawarz

01 May, 2019 02:53 PM

Hi Beshoy

Additionally, I would like to know if I can get the time on the experiment computer from the system variable.

MWorks time (i.e. the time stamp on events, and the times next to messages in the server console) measures elapsed time since MWServer was started. The actual wall-clock time isn't used or stored anywhere by MWorks.

However, when an experiment is started, it announces both the MWorks version and the current date/time, e.g.

00:00:52:  Running MWorks 0.9.dev (2019.05.01)
00:00:52:  Current date/time is Wed May  1 10:42:29 EDT 2019

Using the announced clock time and the corresponding MWorks time, you can compute the offset between the two clocks.

Be warned, however: The clock used by MWorks is "discontinuous", in that it's only running while the CPU is running (as it's derived from a low-level, CPU clock). Hence, any offset you compute between it and wall-clock time becomes invalid if the computer goes to sleep.

Chris

  1. Christopher Stawarz closed this discussion on 21 Jun, 2019 02:15 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac