Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Best way to grab milliseconds?

I'm currently trying to show a specific time format within an SRP Report Table control but I'm not sure if there are any built in SRP or OI functions that would give me this answer. What would be the best way to grab the current milliseconds in OI? During the initialization for my report table, I'm setting the "OLE.ColumnFormat[1]" property as "hh:mm:ss:000AA" which is working fine. My issue is that I cant get the current time in milliseconds to replace the '000'. An example of what's being displayed is '04:35:20:000PM'. (Using the intrinsic time() and date() functions for now).

Comments

  • Maybe take a look at the various msoft time related DLL functions that OI has provided.
    Do a 'time' search in SYSPROG sysprocs for the DLL_.... ones, then google each one and pick the msoft docs related ones.
  • OI doesn't support millisecond precision, only second precision. The problem is, even if you use some WinAPI to get higher precision, OI still only understands time in terms of seconds since midnight. In hindsight, it was unnecessary for the ReportTable to support milliseconds because they will always be 0 unless we come up with a new internal time format.

    I don't want to discourage you from using WinAPI to get higher precision, but you'll have to manage that data yourself from top to bottom--including formatting--since none of the controls nor OI will understand it.
  • The DOSTime(x) subroutine will give you a fraction of a second, but the resulting decimal value is probably only accurate to 1/10 place.

    If you are timing a process, the SRP_Stopwatch utility will return milliseconds - but like Kevin said, you'd have to manage the data a bit and how it would be displayed.
  • Thank you guys, I'll try out WinAPI!
Sign In or Register to comment.