[Solved] Retrieve fractions of a second from time function

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
gurfle
Posts: 67
Joined: Wed Dec 02, 2009 5:40 am

[Solved] Retrieve fractions of a second from time function

Post by gurfle »

I would like to be able to manipulate fractions of a second, but cannot figure out how to get OOo Basic to handle time vaiables with any more precision than a whole second. Is there a way without having to resort to functions outside of the OOo Basic libraries?

Thanks for any insights . . .
Last edited by Hagar Delest on Thu Dec 03, 2009 12:21 pm, edited 1 time in total.
Reason: tagged [Solved].
Nicholas Dreyer
AMD sempron 3.4GHz, 1G RAM, nForce3-250Gb motherboard

AntiX M11
LibreOffice 3.4.3

Posts prior to Aug. 18, 2011 referenced
Linux Debian (lenny-backports or squeeze)
OpenOffice 3.2.1
B Marcelly
Volunteer
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: Can fractions of a second be retrieved from time function?

Post by B Marcelly »

Hi,
Basic function GetSystemTicks returns the value of a counter of milliseconds. However on an IBM-PC compatible the precision is about 16 milliseconds (because of internal HW clock).

Code: Select all

Dim t as long
t = GetSystemTicks
' your process here ---
t = GetSystemTicks - t
MsgBox("Duration : " & t)
______
Bernard
User avatar
gurfle
Posts: 67
Joined: Wed Dec 02, 2009 5:40 am

Re: Can fractions of a second be retrieved from time function?

Post by gurfle »

Thanks. That's just what I need. Precsions down to 16 ms not necessary for now, but thanks for the caveat!

NIck
Nicholas Dreyer
AMD sempron 3.4GHz, 1G RAM, nForce3-250Gb motherboard

AntiX M11
LibreOffice 3.4.3

Posts prior to Aug. 18, 2011 referenced
Linux Debian (lenny-backports or squeeze)
OpenOffice 3.2.1
Post Reply