Re: [Lazarus] How to program with time in milliseconds?
Dear Mr. Michael Van Canneyt, I'm adding some clarification and context to your ongoing comments about EpikTimer in this and other threads. << Snip EpikTimer code>> >Why you would not use fpnanosleep on CPUX86_64 as well is a mystery to me... There's no mystery here. I wrote EpikTimer in 2003 with a few months of experience on a 32 bit version of Lazarus. The code still works, but a lot has changed around it over the last 11 years. > Epiktimer is probably the most overrated component on lazarus-ccr. No idea why people still recommend it, unless I missed something :( No mystery here either. You never miss an opportunity to criticize EpikTimer for reasons I've never been able to understand. If there's another component or technique that does this better, can you please recommend it rather then relentlessly criticizing the one I contributed? >> Of course in the end I need something that works for any CPU and OS. > There is nothing. EpikTimer pretends to fill this gap, but it does not. > Don't get me wrong: I have nothing against the epiktimer, but it is presented as some super cross-platform solution (or so I perceive it). To clarify, EpikTimer was created in 2003 to help simplify the measurement of elapsed time. It used the x86 TSC hardware, if available and reverted to the system clock if it wasn't. I needed this capability and thought others might as well. My original version was documented to only work on 32 bit Linux and was never presented as a "super cross-platform solution". Over the years other contributors modified it for Windows and 64 bit operation. Epiktimer was written during the early days of the Lazarus project when cross platform capability was an evolving dream and the IDE was just starting to be stable on Linux. The code is 11 years old, but despite it's age, EpikTimer still works well, is downloaded many times per week and actively used across a variety of projects. It could use an update and re-release that I was starting to work on but at this point I've lost my enthusiasm to complete it. -Tom On Mon, May 12, 2014 at 7:57 AM, Michael Van Canneyt wrote: > > > On Mon, 12 May 2014, Reinier Olislagers wrote: > > On 12/05/2014 13:32, Michael Schnell wrote: >> >>> On 05/11/2014 09:44 AM, Graeme Geldenhuys wrote: >>> Take a look at EpikTimer. It uses hardware timers where available, with an easy to use API for the developer. >>> >>> IO took a look. >>> >>> Seemingly this is only available for X86 and X86_64. >>> >> How did you get that idea? The wiki page even explicitly mentions ARM. >> > > Yes, it WORKS on arm. > > But on all systems except i386, you can just as well use Now() and > Sleep(), because that is what epiktimer uses: > > (sources quoted from the lazarus-ccr repository) > > function SystemTicks: TickType; > {$IFDEF Windows} > begin > QueryPerformanceCounter(Result); > {$ELSE} > var t : timeval; > begin > fpgettimeofday(@t,nil); > Result := (TickType(t.tv_sec) * 100) + t.tv_usec; > {$ENDIF} > > and > > function TEpikTimer.SystemSleep(Milliseconds: Integer):Integer; > {$IFDEF Windows} > begin > Sleep(Milliseconds); > Result := 0; > end; > {$ELSE} > {$IFDEF CPUX86_64} > begin > Sleep(Milliseconds); > Result := 0; > end; > {$ELSE} > var > timerequested, timeremaining: timespec; > begin > timerequested.tv_sec:=Milliseconds div 1000; > timerequested.tv_nsec:=(Milliseconds mod 1000) * 100; > Result := fpnanosleep(@timerequested, @timeremaining) // returns 0 if ok > end; > {$ENDIF} > {$ENDIF} > > Why you would not use fpnanosleep on CPUX86_64 as well is a mystery to > me... > > Epiktimer is probably the most overrated component on lazarus-ccr. No idea > why people still recommend it, unless I missed something :( > > Michael. > > > -- > ___ > Lazarus mailing list > Lazarus@lists.lazarus.freepascal.org > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File Access Problems in Linux
Mattias, This is the version packaged in the repository for the Kubuntu version I am using. A straight download and install. Yes it is old, repository packages tend to be behind the times. I will install a newer version later today, but doubt if it will make any difference in this case. Also, it is certainly my mistakes or missing steps in my useage. Have quickly set up a Win version of Lazarus 1.2 on a machine running XP. Repeated the design sequence and received the same error message about being unable to open the file for saving. So will be checking all paths and steps. First thought was that the problem is something related to Linux file systems. Second thought, it is me! Gordon On 05/18/2014 09:50 AM, Mattias Gaertner wrote: What version did you install? How did you install it? deb, zip, svn, ...? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File Access Problems in Linux
On Sun, 18 May 2014 09:18:24 +1200 Gordon Cooper wrote: > The error message reads: > > 'Unable to open file "/usr/lib/lazarus/0.9.30.2/" 0.9.30 is a pretty old version. > Note: this is the default file in the Environment Settings. What version did you install? How did you install it? deb, zip, svn, ...? Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Off topic. Version numbers
On Sat, 17 May 2014 21:44:35 +0200 Marco van de Voort wrote: > On Fri, May 16, 2014 at 08:14:11PM +0200, Mattias Gaertner wrote: > > > has changed between releases. Lets just hope nobody else follows the Web > > > Browser versioning scheme. > > > > Even it's only a tiny security bug fix you should use the new > > browser version. Users must not wait for big new browser features. > > True, but that behaviour is independent from the version numbering scheme. Some users underestimate minor versions and some fear updating major versions. A simple counter does not have this psychological ballast. > I agree a bit with Graeme. Such fast incrementing major versions convey > nearly no information anymore. Maybe that is intended. > Yes, old numbering schemes were only correct first magnitude, but at least > they conveyed the intent of developers and relations between releases. > > Moreover, version numbering systems will only be first order for most > projects (except a few very big ones like *nix kernels), since a reality is > simply that testing doesn't uncover all bugs and incompatibilities. I agree that FPC and Lazarus are different and should not use the single number version. I'm indifferent for 2 or 3 numbers. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File Access Problems in Linux
The error message reads: 'Unable to open file "/usr/lib/lazarus/0.9.30.2/" Note: this is the default file in the Environment Settings. Gordon. On 05/17/2014 07:17 PM, Michael Van Canneyt wrote: Can you post the exact error message, please ? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Off topic. Version numbers
On Fri, May 16, 2014 at 08:14:11PM +0200, Mattias Gaertner wrote: > > has changed between releases. Lets just hope nobody else follows the Web > > Browser versioning scheme. > > Even it's only a tiny security bug fix you should use the new > browser version. Users must not wait for big new browser features. True, but that behaviour is independent from the version numbering scheme. I agree a bit with Graeme. Such fast incrementing major versions convey nearly no information anymore. Yes, old numbering schemes were only correct first magnitude, but at least they conveyed the intent of developers and relations between releases. Moreover, version numbering systems will only be first order for most projects (except a few very big ones like *nix kernels), since a reality is simply that testing doesn't uncover all bugs and incompatibilities. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File Access Problems in Linux
Am Saturday 17 May 2014 09:25:43 schrieb Allan E. Registos: > > Have you tried chmod or chown commands? chmod is a bad solution check the project paths/paths of the components youre using -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File Access Problems in Linux
On Saturday, 17 May, 2014 12:38 PM, Gordon Cooper wrote: > Several days ago I posted a request about filing conventions, a > request that had no response. I am asking this again, as I am having > file access problems. Am attempting to use Lazarus on Linux, > specifically > Kubuntu 12.04. > > Having set a separate folder for this, my first Lazarus project, all went > well with form design, addition of components, and compilation until > I added a Tdbf. I was able to define index and memo items, but any > attempt to activate was rejected, the error saying that the _predefined __ > __project folde_r could not be opened. Have you tried chmod or chown commands? > > This had always worked for me over several years of TP and then Delphi > on Windows, so there is obviously something I am missing in the Linux > implementation. I have tested this several times to the extent of > completely > deleting all of the project's files and starting again with a blank form. > > Regards, > Gordon > > > -- > ___ > Lazarus mailing list > Lazarus@lists.lazarus.freepascal.org > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus smime.p7s Description: S/MIME Cryptographic Signature -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File Access Problems in Linux
On Sat, 17 May 2014, Gordon Cooper wrote: Several days ago I posted a request about filing conventions, a request that had no response. I am asking this again, as I am having file access problems. Am attempting to use Lazarus on Linux, specifically Kubuntu 12.04. Having set a separate folder for this, my first Lazarus project, all went well with form design, addition of components, and compilation until I added a Tdbf. I was able to define index and memo items, but any attempt to activate was rejected, the error saying that the predefined project folder could not be opened. Can you post the exact error message, please ? Michael. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Extended format codes in FormatDateTime (Michael Van Canneyt)
On Sat, 17 May 2014, Werner Pamler wrote: I just uploaded a new patch to bug tracker. The new version picks up Michael's suggestion of introducing a new FormatDateTimeEx function for the new format codes. Damn, I was rather hoping you'd go for the extra argument :) No sweat, I'll rework it, thanks for the contribution. Michael. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus