Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does Timer Affect Performance

Status
Not open for further replies.

SalehKiswani

IS-IT--Management
Jul 16, 2011
60
Hi All,
THis a preformance question.

If I apply a timer interval to a window to a do job every certain period, lets say 3 minutes. During these 3 minutes does the performance of the application affected.

Regards
 
Hi!

It depends on what you are doing. If it is going to be disk/processor intensive, other applications will be affected. More details on what you want to achieve will help me give you a better feedback.

And with timers always remember to set it to 0 while processing and then reset it i.e.

Code:
LastTime     TIME

OPEN(Window)

Window{PROP:Timer} = 6000  ! every minute

ACCEPT

  CASE EVENT()
  OF EVENT:Timer
    IF (CLOCK() - LastTime) > 18000 OR CLOCK() < LastTime ! midnight rollover
       Window{PROP:Time} = 0
       ... Do Processing ...
       Window{PROP:Time} = 6000
       LastTime = CLOCK()
    END
  END

END

CLOSE(Window)

Regards
 
Hello
Iam creating an application that captures the texts or images in clipboard, thanks to you shanker I used freeimage classes as you advised in my thread "Capture Images from memory with Clipboard Function" .

so my plan is to use the timer to check the clipboard each 5 seconds. if there are changes in clipboard it will be saved to a logfile.

so I have only one problem now that if the clipboard contents wasnt change , it will duplicate the values in my log file.
for text contents it is no problem that I can compare the clipboard contents with the previous one , but not if the content is an image.
also wondering if this routine with the timer each 5 seconds will affect the performance?

regards


 
Hi!

There are Clipboard Managers already available - why are you re-inventing the wheel?

You can set the timer to 100 i.e. 1 sec and process every 5 seconds. If your processing time is short it should not make any impact on performance.

You can always process duplicates by comparing against the previous data captured by having different storage area for different formats i.e. text or binary.

Regards
 
Hello
About creating such tools I have two goals, one is that I can embed it in my applications and the other is gaining more knowledge with such discussions.

About our subject , you mean that I should compare the physically created file ?

is there a way to save the clipboard contents when it is an image to a memory variable?

Thank you

Best Regards
 
Hi!

You need to store WHATEVER you are getting from the CLIPBOARD contents into memory variable so that you can compare the next time. Since the size would vary use reference strings (&STRING) or create a dummy Topspeed table with BLOB columns. You can assign to the BLOBs without saving the row/record.

Regards
 
Hello Shanker,
I created a Topspeed table with BLOB columns and succeded to capture clipboard images and store them in the BLOB field but failed to compare the values.

Can you please explain more .

regards
 
sorry , adding to above , I assigned the clipboard images to two blob fields and let the program assign the clipboard image to one field at a time. but I could'nt know how to compare the contents of the fields


THank you
 
Hi,

Blobs are zero-based strings. So, you compare them with string splicing i.e.

Code:
MyBLOB           BLOB
MyClipBoard      STRING(1024)

IF MyBlob{PROP:Size} > 1 AND LEN(CLIP(MyClipBoard)) > 1
   IF MyBLOB[0 : (MyBlob{PROP:Size}-1)] = MyClipBoard[1 : LEN(CLIP(MyClipBoard))]
      !contents are similar
   ELSE
      !contents are NOT similar
   END
END

Regards
 
Everything is fine now .. thank for your help

Best Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top