Re: [fpc-pascal] timing again
spir ☣ het geskryf: > let down for a while because other problems required my attention. So, I > need a simple func to get the current time; mainly to benchmark various > implementation choices, possibly for other needs. A very crude solution would be to use Sysutils.GetTickCount() before and after a procedure - then calculate the difference (end - start), but if you want more control and higher resolution timing - like in the case of profiling your applications, I would suggest EpikTimer (Felipe posted the link). EpikTimer is a non-visual component, so can even be used in console applications. Note: I can't remember if I submitted a patch for EpikTimer, breaking the dependency on LCL. Originally EpikTimer only had one design-time package, meaning it gets registered in the Lazarus IDE - hence a dependency on LCL. But EpikTimer is non visual, so I split the package in two (Runtime and Designtime). The latter is the only one that now depends on LCL. The Runtime package can be used in Console apps, fpGUI apps etc.. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] timing again
Felipe Monteiro de Carvalho het geskryf: > You can use EpikTimer for that: > > http://wiki.lazarus.freepascal.org/EpikTimer > Included in the lazarus-ccr bug report is the patch that splits the EpikTimer package into Runtime and Designtime packages. Could you apply this to Lazarus-CCR please. http://bugs.freepascal.org/view.php?id=16510 Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] timing again
On Mon, May 17, 2010 22:25, spir ⣠wrote: Hello Denis, > I posted a question about timing some time a go and got an answer; but let > down for a while because other problems required my attention. So, I need > a simple func to get the current time; mainly to benchmark various > implementation choices, possibly for other needs. . . If you need a high-resolution timer and only x86 platforms (or maybe x86_64 too), one option would be using the timer available in http://members.yline.com/~tom_at_work/cpudist.zip (see http://members.yline.com/~tom_at_work/ for link to documentation and further information). A completely platform independent solution included in FPC RTL but with lower precision is using either Dos.GetTime, Dos.GetMsCount or one of functions provided in unit SysUtils (e.g. GetLocalTime, Time or Now). Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Stack fault under WinCE
Hello, I am getting a stack overflow under Windows CE and I am rather lost about what it could be. Sure it could be an infinite loop, but the app doesn't hang, and the same code runs fine under Desktop Windows... Trying to get the backtrace also doesn't help, because it seams that it is emptied ... any ideas how to find where this happens? Can I increase the stack size somehow? Despite the fact that WinCE docs say that Windows will use whatever memory available for it ... warning: [Stack fault]: Thread=96a386e8 Proc=80097120 'simpletest.exe' warning: AKY=00010011 PC=88039c8c(NK.EXE+0x9c8c) RA=8803a198(NK.EXE+0xa1 98) BVA=22af1fe4 FSR=0407 Program received signal SIGSEGV, Segmentation fault. 0x88039c8c in ?? () (gdb) bt #0 0x88039c8c in ?? () docs on the subject: http://support.microsoft.com/?scid=kb%3Ben-us%3B326162&x=7&y=2 thanks, -- Felipe Monteiro de Carvalho ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal