timer logic
| Thu, 2008-08-28 11:18 | |
|
|
Hi all, i want to create a timer which would be calling a function on a variable interval of time. i want the following type of code.I dont say that it is working code but i want the code of this type. int timeinterval = 30;Please help me... can i use CActive derived class and over load Run() function but i dont know to use in this manner.So i request you to please give me the code working correctly in symbian C++ like this. Thank you vey much in advance... Life is too short ! so do as many good things as you can do... |






Forum posts: 85
If the callback interval won't change then you should take a look at
CPeriodic, it might save you from reinventing the wheelForum posts: 159
But the CPeriodic call a callback function in every fixed interval of time , but i want the callback function to be called after diffrent intervals.And we can give that interval only when we create the CPeriodic object .
Life is too short ! so do as many good things as you can do...
Brajesh Kumar...
Beginner in Symbian C++
Forum posts: 85
Then you should derive your class from
CTimerand implement theRunL()method. This way you can start the timer by calling e.g.After(), and you can also issue another request with a different interval fromRunL().Forum posts: 672
RTFM: CDeltaTimer...
Forum posts: 1233
CDeltaTimer sounds a bit overkill to me...
I'd choose a normal CTimer-derived class that from the RunL call a callback, and then call "After" with the return value of the callback, or stopping if return value is negative (error)