en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en nl en en en en sq de en en en en en nl en en en en en en fr en en en en en en fr en en en en nl en en en en en en en en fr en en fr pt en en en en en en en nl en en en en es en en en en en en en en en en nl en en en en en en en en en en en en en nl en en en en en en en en en en en en fr en en en en nl vi en en en en fr en en fr pt en en en en nl en en en en en en en en en en en en en de en en en fr en en en en en en en en en pt en en en en en en
By logging into your account, you agree to our Privacy Policy, personal data processing and storage practices as described therein.
Forgot password or user name?
Search in titles only Search in PowerBASIC for Windows only
You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
All Time Today Last Week Last Month
All Discussions only Photos only Videos only Links only Polls only Events only
Is it possible to time the execution of a PBDLL program without creating or showing a dialog? I want to time the response of a synchronous SHELL but not show any dialog.
Join Date: Oct 1987
9 Mar 2000, 02:38 PM
Won't the good ol' TIMER function do what you want?
DIM dpStart AS LOCAL DOUBLE dpStart = TIMER SHELL (whatever) dpElapsed = TIMER-dpStart
It gets a little more complex if the shell operation could "cross midnight" (start before and end after 23:59:59) but you get the idea...
Perfect Sync: Perfect Sync Development Tools
Email: mailto:[email protected][email protected]
"Not my circus, not my monkeys."
Join Date: Aug 1998
10 Mar 2000, 02:07 AM
Other options, probably too wild, but just to demonstrate that there are quite a few alternative methods once we use a bit of lateral thinking:
1. GetTickCOunt() has a resolution in milliseconds and only wraps at 49.7 days. Save the count before the SHELL, and subtrack it after - exactly the same technique as Eric's TIMER suggestion above.
2. If you are using NT, then you can query "System Up Time" in the HKEY_PERFORMANCE_DATA section of the registry.
3. Create a "log" file before and after the SHELL, and re-engineer the values stored in the FILETIME structure (which stores the time/date as a "64-bit value representing the number of 100-nanosecond intervals since January 1, 1601"
4. Use the GetSystemTime() API before and after, etc.
Join Date: Oct 1987
10 Mar 2000, 04:20 AM
As long as we're creating a list...
1) The CoFileTimeNow API can be used to obtain a QUAD integer with the same properties that Lance described in (3) above, without creating a file. "File time" in this case refers to a data format, not an association with an actual file. The nice thing about a FileTime is that it never rolls over. (At least not for 30,000 years, or something like that, so it would be a Y32K problem.)
MSGBOX "Click OK and start your stopwatch..." SHELL (whatever) MSGBOX "Stop the stopwatch NOW!"
Perfect Sync: Perfect Sync Development Tools
Email: mailto:[email protected][email protected]
"Not my circus, not my monkeys."
11 Mar 2000, 05:10 PM
Here's a sample of using the performance counters.
DECLARE FUNCTION QueryPerformanceCounter LIB "KERNEL32.DLL" ALIAS "QueryPerformanceCounter" (lpPerformanceCount AS QUAD) AS LONG DECLARE FUNCTION QueryPerformanceFrequency LIB "KERNEL32.DLL" ALIAS "QueryPerformanceFrequency" (lpFrequency AS QUAD) AS LONG FUNCTION PBMAIN DIM freq AS QUAD, a AS QUAD, b AS QUAD,overhead AS QUAD, i AS LONG, results AS EXT queryperformancefrequency freq queryperformancecounter a queryperformancecounter b overhead = b-a queryperformancecounter a MSGBOX "close me" queryperformancecounter b results = ((b - a)-overhead) / freq MSGBOX FORMAT$(results,"##0.0000") & " seconds." END FUNCTION
Join Date: Nov 1999
11 Mar 2000, 06:13 PM
The PerformanceTimer is a nice tool, my AMD 350 is accurate to over 1 billion parts of a second...
But, if it is counting that fast, how long until it rolls over? The Win32API help file didn't say anything about roll over.
So I was wondering, if you don't mind, could you share your experience using it?
Colin Schmidt & James Duffy, Praxis Enterprises, Canada
Join Date: Aug 1998
12 Mar 2000, 01:17 AM
It is processor dependent. It is also documented in WIN32.HLP... bring up "QueryPerformanceCounter" and click OVERVIEW, then scroll about 3 pages in.
Basically, you can calculate the period yourself, using "QueryPerformanceFrequency". A LARGE_INTEGER (as WIN32.HLP specifies is equivalent to a QUAD in PowerBASIC.
12 Mar 2000, 03:19 PM
Lance hits the nail on the head again.
Just integer divide 9,220,000,000,000,000,000 by Freq.
That should give you the number of seconds before rollover.
DECLARE FUNCTION QueryPerformanceFrequency LIB "KERNEL32.DLL" ALIAS "QueryPerformanceFrequency" (lpFrequency AS QUAD) AS LONG FUNCTION PBMAIN LOCAL result AS QUAD, freq AS QUAD QueryPerformanceFrequency Freq result = 9220000000000000000&& \ freq ' seconds \ minutes \ hours \ days \ years MSGBOX STR$(result \ 60 \ 60 \ 24 \ 365) END FUNCTION
My P3-500 was about 81676 years.
Copyright © 1998-2022 PowerBASIC Tools, LLC - All Rights Reserved.
Powered by vBulletin® Version 5.7.0
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
All times are GMT-5. This page was generated at 04:00 AM.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.