Home » U++ Library support » U++ Callbacks and Timers » extracted Timer from Ctrl
extracted Timer from Ctrl [message #24401] |
Thu, 14 January 2010 12:28 |
|
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
hi there
i was in need of easy and quick solution for a timer queue, usable without the Ctrl stuff, that said, with Core only. so i extracted timer behaviour from Ctrl and put it in a class, which is running a Thread to work the queue, its really a quick solution, you cant set granularity for now, but this one can be extended.
it has same API as the Ctrl Timer, so one can setup callbacks.
maybe its usable for someone.
greets
Timer: the timer class itself
TimerTest: Test class for timer. really quick, "proof of concept"
|
|
|
Re: extracted Timer from Ctrl [message #24404 is a reply to message #24401] |
Thu, 14 January 2010 17:38 |
|
mirek
Messages: 14039 Registered: November 2005
|
Ultimate Member |
|
|
kohait00 wrote on Thu, 14 January 2010 06:28 | hi there
i was in need of easy and quick solution for a timer queue, usable without the Ctrl stuff, that said, with Core only. so i extracted timer behaviour from Ctrl and put it in a class, which is running a Thread to work the queue, its really a quick solution, you cant set granularity for now, but this one can be extended.
it has same API as the Ctrl Timer, so one can setup callbacks.
maybe its usable for someone.
greets
Timer: the timer class itself
TimerTest: Test class for timer. really quick, "proof of concept"
|
Maybe you might want to put it to the bazaar?
Mirek
|
|
|
|
|
Re: extracted Timer from Ctrl [message #24412 is a reply to message #24405] |
Fri, 15 January 2010 15:46 |
andrei_natanael
Messages: 262 Registered: January 2009
|
Experienced Member |
|
|
kohait00 wrote on Thu, 14 January 2010 21:17 | hi mirek
no problem with that..i dont know how to add it there.
i will be on improving it a bit, hope it works out.
is there a general howto for people who think of contributing to upp, how they can do it, what ways they have to do so, what things to take care of, what tools to use, have not found any..
|
A little How To:
Request svn access from Mirek. He will give you write access to bazaar directory from svn repository. Any change you make to bazaar directory will be recorded in repository "history".
Tools needed for that: subversion and theIDE. TheIDE have svn integration, that means you may commit directly from theIDE or if you prefer you may commit from your favourite svn client (svn from CLI, TortoiseSVN, KDESvn, etc.). IIRC theIDE search for svn client in PATH environment variable, there you should put your path to svn client if it's not done automatically by it's installer (in cases when you install from archive).
You should take care to not modify others packages (you may have write access to them, i don't know how rights are distributed in bazaar). When you commit always put a comment about changes.
If your commits are related to U++ core not bazaar you may create patches for your changes and upload them to forum. Mirek will review and accept or reject them.
You may read a tutorial about svn if you want to know a bit deeply how it works.
Andrei
|
|
|
|
Re: extracted Timer from Ctrl [message #24886 is a reply to message #24884] |
Wed, 03 February 2010 08:13 |
|
koldo
Messages: 3394 Registered: August 2008
|
Senior Veteran |
|
|
kohait00 wrote on Wed, 03 February 2010 07:05 | thank you andrej.
this info should be placed somewhere in the docu, in things like "how to contribute" or similar. because, frankly, patches are placed in wild forms, plain text, diff, source files etc.. good for users, bad for mirek. time consuming. that should be unified a bit, with a short tutorial how to provide patches etc.. diff prefered.. so mirek can actually review things esier.
greets
|
Hello Mirek
Answering kohait comments, this: http://www.ultimatepp.org/www$uppweb$bazaar_support$en-us.ht ml is included in Bazaar, but this or something similar could be in main web pages:
Perhaps some new page linked from manual page: http://www.ultimatepp.org/www$uppweb$documentation$en-us.htm l
If you agree and do not have time to do it I can.
Best regards
Iñaki
|
|
|
|
|
|
|
Re: extracted Timer from Ctrl [message #25323 is a reply to message #25313] |
Wed, 17 February 2010 09:32 |
|
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
i can do some maitanance.. concerning documentation, there isn't actually that much.
1) The Interface is the same as used from the Ctrl::TimerCallback in CtrlCore
2) To use it one does *not* need CtrlCore anymore, simply Core and Timer, where the application has a Timer instance.
3) should keep in mind, that it's a timer *queue* other things wont get to execution, until a current task is finished, and the timer queue can check whether time has come for the next task.
4) because of 3), the timing is not as accurate as maybe desired and can have "timer glitches/jitter", depending on work load..
5) favorite use is to schedule some *non*-timing-critical work for "somwhere-around-in-the-future".
6) for timing critical stuff, consider using OS native timer means, for WIN32 SetTimer (in windowing environment, using WM_TIMER callback) or CreateWaitableTimer for windowing-independant stuff, or even QueryPerformanceCounter. for Linux/Unix/Posix settimer function, but for linux there is a lot anyway.
thats basicly all
|
|
|
Re: extracted Timer from Ctrl [message #25380 is a reply to message #25323] |
Sat, 20 February 2010 00:44 |
|
koldo
Messages: 3394 Registered: August 2008
|
Senior Veteran |
|
|
kohait00 wrote on Wed, 17 February 2010 09:32 | i can do some maitanance.. concerning documentation, there isn't actually that much.
1) The Interface is the same as used from the Ctrl::TimerCallback in CtrlCore
2) To use it one does *not* need CtrlCore anymore, simply Core and Timer, where the application has a Timer instance.
3) should keep in mind, that it's a timer *queue* other things wont get to execution, until a current task is finished, and the timer queue can check whether time has come for the next task.
4) because of 3), the timing is not as accurate as maybe desired and can have "timer glitches/jitter", depending on work load..
5) favorite use is to schedule some *non*-timing-critical work for "somwhere-around-in-the-future".
6) for timing critical stuff, consider using OS native timer means, for WIN32 SetTimer (in windowing environment, using WM_TIMER callback) or CreateWaitableTimer for windowing-independant stuff, or even QueryPerformanceCounter. for Linux/Unix/Posix settimer function, but for linux there is a lot anyway.
thats basicly all
|
Hello Kohait
Now it is included in Bazaar
Best regards
Iñaki
|
|
|
Goto Forum:
Current Time: Sat Sep 21 04:31:30 CEST 2024
Total time taken to generate the page: 0.04075 seconds
|