Tepiktimer, 64 bit environment lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- marmin · 2006-09-16 16:06 Hi! In a 32 bit environment I use the TEpiktimer component (actually I stripped it down a bit) which is an excellent cross platform tool. But, I have installed a 64 bit lazarus/fpc environment and Tepiktimer will not compile on my machine. Errors: Can't find unit 'oldlinux'. I tried to make it work and failed a bit. I replaced some units with new ones (linux.pp, unix.pp) and made some adjustments to code, It compiles now but I will not work.I also noticed there's a bit of assembler in it. This means that it won't run on a 64 machine, right?  I am looking for a (cross platform) 64 bit replacement high precision timer. Can anyone point me to a solution.. Marcel. ---------------------------------------------------------------------- felipemdc · 2006-09-16 16:42 > I also noticed there's a bit of assembler in it. This means that it won't run on a 64 machine, right? No, that assembler is inside a IFDEF only for i386 > Can anyone point me to a solution.. I don´t know what is wrong and needs fixing, but I sugest you look at epiktimer code and try to find out what is wrong, and then tell us. This way everyone will benefit from a epik timer that works on 64 bits machines too. ---------------------------------------------------------------------- marmin · 2006-09-16 18:00 I will try. I've only read that 64 bit precision timers are fundamentally different than 32 bit.. maybe I need to read less. ---------------------------------------------------------------------- felipemdc · 2006-09-16 19:54 Quote from: "marmin"I will try. I've only read that 64 bit precision timers are fundamentally different than 32 bit.. maybe I need to read less. Not a problem at all if they are. In that case just use some IFDEFs for the different parts. The important thing is to have a single component that works on all target platforms. ---------------------------------------------------------------------- Vincent Snijders · 2006-09-16 20:37 Oldlinux is the old (fpc 1.0.x) linux unit. It is for i386-linux only. It only exists in 2.0 for legacy purposes (keeping old code compilable). The recommended way is to replace the oldlinux by baseunix, unix and/or linux unit. See this PDF document for the differences. Most of the time linux specific calls are not needed, so you can leave out the linux unit. In that case, the component will be a generic unix component that can be used in FreeBSD and Mac OS X too. ---------------------------------------------------------------------- marmin · 2006-09-17 00:22 I have gotten it to work. I replaced some code. I have tested it with the old epiktimer, it seems to be exact.(only tested this on linux) Anyone with a 64 bit AMD and Linux please test it here: http://www.marmin.hjhosting.nl/etc/epiktimer_demo_64bit source code http://www.marmin.hjhosting.nl/etc/epiktimer.pas This is not a package, create it by t := tepiktimer.create(self); // on a form and fill in the data manually. didn't have the time.. ---------------------------------------------------------------------- felipemdc · 2006-09-17 16:53 Ok, my intention after this was tested by others is to integrate this code into the official EpikTimer package. So, please put any changes you do inside IFDEFs ---------------------------------------------------------------------- marmin · 2006-09-17 18:51 There is not much change. In fact this works (of course tested only on my systems) on 32 bit and 64 bit. Quotehe recommended way is to replace the oldlinux by baseunix, unix and/or linux unit. See this PDF document for the differences. In fact that 's what I did. 'EpochToLocal' is a function that is in the old linux, and not in the new ones. ---------------------------------------------------------------------- felipemdc · 2006-09-29 13:44 Ok, I am trying to merge the changes in a way it will work for all systems, and I have some doubts: 1 - Why did you remove the register procedure? 2 - If EpochToLocal is obsolete, shouldn't we substitute it with something else? It works without it? 3 - We cannot just substitute SystemSleep with Sleep, because this change will affect all platforms. I will put an extra IFDEF inside SystemSleep for 64 bits unix systems. ---------------------------------------------------------------------- felipemdc · 2006-09-29 14:14 I sent you an e-mail with the new version of epiktimer. ---------------------------------------------------------------------- marmin · 2006-09-29 16:37 Quote 1 - Why did you remove the register procedure? 2 - If EpochToLocal is obsolete, shouldn't we substitute it with something else? It works without it? 3 - We cannot just substitute SystemSleep with Sleep, because this change will affect all platforms. I will put an extra IFDEF inside SystemSleep for 64 bits unix systems. 1) That was just for 'private' use  , I just create an epiktimer in the code, it's faster for me.  I was too 'lazy' to put the new changes in the official one. But it should work with the official one. 2) Yes. But i don't know what.     3) I got 'division by zero' errors when Using systemsleep when calibrating the timer. This must happen when using systemsleep. The function systemsleep makes use of the function NanoSleep, maybe it's that, i'm  not really sure, i'm not very familiar with that. But the output is , in my case, the same when I substitute it with Sleep. This is only a Linux problem I think, i've only tested it with Linux (ubuntu 64) I just spent a night on it, just to prove that it does work. Needs some fine tuning. :wink: ---------------------------------------------------------------------- felipemdc · 2006-10-05 00:41 2) EpochToLocal isn't obsolete, it's in one of the many Unix units, I readded it. 3) I created a IFDEF for 64-bits Unixes. Marmin, what is your full name? I would like to add it to the contributors list of the component. Also, the next version will change license from LGPL to Modifyed LGPL. ---------------------------------------------------------------------- marmin · 2006-10-05 13:19 Didn't have the time to test it.  If anyone has a 64 system , please install it and test.. it''s not enough only a test on my machine. my name is Marcel Minderhoud. ---------------------------------------------------------------------- marmin · 2006-10-09 18:58 No bugs on my machine. (amd64-3200).