Does Timer Affect Performance
Does Timer Affect Performance
(OP)
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
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
RE: Does Timer Affect Performance
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
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
RE: Does Timer Affect Performance
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
RE: Does Timer Affect Performance
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
RE: Does Timer Affect Performance
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
RE: Does Timer Affect Performance
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
RE: Does Timer Affect Performance
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
RE: Does Timer Affect Performance
THank you
RE: Does Timer Affect Performance
Blobs are zero-based strings. So, you compare them with string splicing i.e.
CODE
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
RE: Does Timer Affect Performance
Best Regards