• Get System Time with millisecond accuracy

    From dsubri@gmail.com@21:1/5 to Peter Seed on Mon Feb 19 09:16:42 2018
    On Friday, 3 August 2001 16:36:07 UTC+2, Peter Seed wrote:
    #include <time.h>
    #include <types.h>
    ...
    time_t timeNow;
    u_int32 ticks;
    u_int32 hundredths;

    error = _os_getime (&timeNow, &ticks);
    /* ticks contains the ticks per second in the MS 16 bits, the number of
    ticks THIS second in the LS 16 bits */
    /* So, assuming a 100Hz ticker.. Otherwise, do your own thing. */ hundredths = ticks & 0xffff ;


    wegie wrote in message <62075fc3.0108030552.28e99b36@posting.google.com>... >Can anyone please tell me how I can get the system time
    including milliseconds on OS9?

    10 millisecond resolution would suffice.

    Cheers

    Wegie

    what is the type of error here??

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Allan R. Batteiger@21:1/5 to dsubri@gmail.com on Mon Feb 19 22:26:18 2018
    dsubri@gmail.com wrote in news:ff2152e4-95ce-434e-bee4-a3bab2ee3a18@googlegroups.com:

    On Friday, 3 August 2001 16:36:07 UTC+2, Peter Seed wrote:
    #include <time.h>
    #include <types.h>
    ...
    time_t timeNow;
    u_int32 ticks;
    u_int32 hundredths;

    error = _os_getime (&timeNow, &ticks);
    /* ticks contains the ticks per second in the MS 16 bits, the number
    of ticks THIS second in the LS 16 bits */
    /* So, assuming a 100Hz ticker.. Otherwise, do your own thing. */
    hundredths = ticks & 0xffff ;


    wegie wrote in message
    <62075fc3.0108030552.28e99b36@posting.google.com>...
    Can anyone please tell me how I can get the system time
    including milliseconds on OS9?

    10 millisecond resolution would suffice.

    Cheers

    Wegie

    what is the type of error here??


    Which verison of OS-9 ? Which CPU ?

    ---
    This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Allen Huffman@21:1/5 to dsu...@gmail.com on Mon Feb 19 17:24:19 2018
    On Monday, February 19, 2018 at 11:16:43 AM UTC-6, dsu...@gmail.com wrote:
    On Friday, 3 August 2001 16:36:07 UTC+2, Peter Seed wrote:
    #include <time.h>
    #include <types.h>

    error = _os_getime (&timeNow, &ticks);

    what is the type of error here??

    "error_code" from <types.h> in the Ultra-C compiler.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From kaosengr@21:1/5 to Allan Batteiger on Fri Feb 23 05:17:22 2018
    On Monday, February 19, 2018 at 4:26:23 PM UTC-6, Allan Batteiger wrote:

    On Friday, 3 August 2001 16:36:07 UTC+2, Peter Seed wrote:
    #include <time.h>
    #include <types.h>
    ...
    time_t timeNow;
    u_int32 ticks;
    u_int32 hundredths;

    error = _os_getime (&timeNow, &ticks);
    /* ticks contains the ticks per second in the MS 16 bits, the number
    of ticks THIS second in the LS 16 bits */
    /* So, assuming a 100Hz ticker.. Otherwise, do your own thing. */
    hundredths = ticks & 0xffff ;


    wegie wrote in message

    Can anyone please tell me how I can get the system time
    including milliseconds on OS9?

    10 millisecond resolution would suffice.

    Cheers

    Wegie

    what is the type of error here??


    Which verison of OS-9 ? Which CPU ?

    ---
    This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

    The error_code returned will be 0 if no error occurred. The OS9 Technical Reference manual has a section on processing the returned error_code value.

    For reading the time, hopefully, no error occurs, 0 returned, thus the value can be ignored.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)