Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi all,
The Timer() function in basic returns the (system?) time in seconds.  Is
there another function that has a better resolution?  I want to time how
long it takes to execute a certain function in LibreOffice Basic and I would
like to have smaller increments than 1 second.  I'm talking about something
like this:

 -= Start of code =-

dim startTime as single
dim stopTime as single

startTime = Timer()
someTimeConsumingSub()
stopTime = Timer()
MsgBox "It took " & stopTime - startTime & " second(s) to execute the code"

 -= End of code =-

Typically, this would result in something like:
It took 2 second(s) to execute the code

I would like something like:
It took 1.957 second(s) to execute the code

The reason I'm using the Timer() function is because I know in VBA it works
like the second example.  Does anyone know of a function or workaround that
I can use?

Regards
Jack



--
View this message in context: 
http://nabble.documentfoundation.org/BASIC-Timer-function-only-has-resolution-of-1-second-tp2819804p2819804.html
Sent from the Users mailing list archive at Nabble.com.

-- 
Unsubscribe instructions: E-mail to users+help@libreoffice.org
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/www/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.