I.T. Discussion Community!
-Collapse +Expand
Paradox
Search Paradox Group:

Advanced
-Collapse +Expand Paradox To/From
To/FromCODEGuides
-Collapse +Expand Paradox Store
PRESTWOODSTORE

Prestwood eMagazine

February Edition
Subscribe now! It's Free!
Enter your email:

   ► KBDesktop Data...Paradox & Ob...ObjectPAL Co...OPAL: Commands   Print This     
  From the February 2010 Issue of Prestwood eMag
 
Paradox OPAL: Commands:
Testing the Speed of Your code
 
Posted 11 years ago on 6/5/2008
Take Away: To test the speed of your code, capture the time before and after your code executes and view the milliseconds between the two dates.

KB101163



Because there are many ways in ObjectPAL to accomplish a given task, you often need to test the speed of two routines. ObjectPAL offers, in the form of the time() method, an easy way to do this. To calculate the amount of time a scan loop takes on the CUSTOMER table, type in lines 3-19 into the ushbutton event of a button:

 1: ;DATATYPE :: btnSpeed :: pushbutton
 2: method ushbutton(var eventInfo Event)
 3: var
 4:   tcCustomer  Tcursor
 5:   tBeg, tEnd  Time
 6:   nDifftime   Number
 7: endVar
 8:
 9: tcCustomer.open("CUSTOMER.DB")   ;Open CUSTOMER.DB table.
10:
11: tBeg = time()  ;Grab current time.
12: scan tcCustomer:
13:   ;Nothing here. Just testing scan time.
14: endScan
15: tEnd = time()  ;Grab current time.
16:
17: ;The following calculates the number of milliseconds that passed.
18: nDiffTime = number(tEnd) - number(tBeg)
19: nDiffTime.view("Milliseconds to scan Customer table")
20: endMethod

The preceding routine opens the CUSTOMER table, gets the current time, scans the CUSTOMER table, and then gets the current time again. Finally, it calculates the duration of the scan loop and displays it in milliseconds. Use the preceding technique whenever you need to know how fast a routine is in ObjectPAL-for example, when you discover two ways to accomplish the same task and need to determine which is faster.

More Info

Tip:  Speed Up TCursors with setBatchOn()

Linked Message Board Threads

 BIG problem with speed of application. Very URGENT in ObjectPAL MB Topic (14 replies)
 Improving speed when moving form to form. in ObjectPAL MB Topic (7 replies)
 Increase query speed in ObjectPAL MB Topic (4 replies)

Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1215A1
Enter key:
KB Post Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #101163 Counter
7507
Since 6/5/2008
-
   Contact Us!
 
PrestwoodBoards.com was developed and is maintainted by me. Do you have a question or suggestion? Do you see a problem? Contact me now. My goal is to build an ad-free and spam-free source of I.T. information with many contributers (ok to promote your website/company in your bio). Yes, my company Prestwood IT Solutions is mentioned in my bio which shows with every post, but you can contribute and promote your pet project too!

2,136 People Online Now!!  
Sign In to see who's online now!  Not a member? Join now. It's free!
Show more stats...


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech