Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] timing for geeks II.
- Date: Mon, 19 Dec 2005 08:04:57 +0100
- From: Michal Hajek <hajek1@example.com>
- Subject: Re: [tlug] timing for geeks II.
- References: <20051202154627.GB4348@example.com> <20051202152527.302e2f6f.jep200404@example.com> <20051203122655.GG4348@example.com> <20051203092314.3118db01.jep200404@example.com> <20051204100726.GH4348@example.com> <30ce84360512040313l351f16c4r1872cb4f6f34679e@example.com> <20051206082734.GB4319@example.com> <20051218162310.GD4525@example.com> <20051218113431.4bc2cf29.jep200404@example.com>
- User-agent: Mutt/1.5.11
Hello :) * Jim (jep200404@example.com) [051218 17:34]: > What problem are you actually trying to solve (or understand)? Exceptionally good question actually :) I apologise, I should have cleared this one right from the beginning of the thread.... The story is somewhat more complex, but I will try to put it as simple as possible, since what I am doing is merely an exercise and learning "how this particular stuff works" more than anything else. I am trying to figure how precisely can I measure time with pc running linux. So I would like to know, if I just install debian 3.1 on i386 with latest distro kernel and no special hw, run my application measuring some physical quantity (eg. sample voltage, temperature... etc.), what is the uncertainty which I get _exclusively_ from time measurement. Closely following is the question, whether I can improve it with some quite easy "tuning". In my code I was originally using ftime(), which was quickly replaced by gettimeofday(). Ok, let me see if there is something even better... hmmm, I see some clock_gettime()... does it perform any better? Well, experiments show that not really, although it perhaps could be a better option on some circumstances (though I do not know yet exactly what these are). What other options do I have? Ok, I might patch kernel and try some more real-time oriented stuff. Or maybe I can buy a cheap crystal (say 10$) and use it as a better clock somehow, or ... ? :) This link seems to be quite attractive for me: http://source.mvista.com/~ganzinger/hrt/home_page.html The links for embedded RT-linux (Montavista) suggested by Steve seems to me on the first glimpse to be more work. But I did not explore it well yet. The solaris (mentioned by Josh) might be an option as well. But I do not have any experience with solaris on i386. So this basically seems to be more work than, say, installing new patched kernel. Or maybe I can synchronise clock using ntpdate before every single data acquisition? Now the topics get more complex, since I shall figure precise timing of my experiment - how long does it take to switch relay, how long does it take to nanovoltmeter to measure voltage, how long does it take to determine temperature, how long does it take to transfer results, how long does it take ... and is it possible to measure these delays with pc (gettimeofday) ? Or how should I measure it anyway? :) Another idea is to give higher priority to my measurement program. Since you say that the biggest delay is from OS (only once in a relatively long time, but still...), this could be one example of cheap tuning :) Well, right now I have a program which marks absolute time of the measurement with gettimeofday() and it serves quite well to the purpose. And the plan is to make these measurements (means voltage, temp..) time to time for next few decades, so I have some time to think about improvements in the meantime :)) Oh, I shall perhaps mention that single measurement run takes about two days. Hmm, if I read my post from the top to the bottom, I am not sure if I answered the original question. But I hope I have offered clearer view on my line of reasoning. After all, "having work done" and "having no questions" are two completely different things, aren't they? :)) Best regards Michal
- Follow-Ups:
- Re: [tlug] timing for geeks II.
- From: Ian Wells
- References:
- [tlug] timing for geeks :)
- From: Michal Hajek
- Re: [tlug] timing for geeks
- From: Jim
- Re: [tlug] timing for geeks
- From: Michal Hajek
- Re: [tlug] A Rich Experiment Indeed
- From: Jim
- Re: [tlug] A Rich Experiment Indeed
- From: Michal Hajek
- Re: [tlug] A Rich Experiment Indeed
- From: Ian Wells
- Re: [tlug] timing for geeks II.
- From: Michal Hajek
- Re: [tlug] timing for geeks II.
- From: Michal Hajek
- Re: [tlug] timing for geeks II.
- From: Jim
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Bank Securely from a Windows PC with spyware
- Next by Date: [tlug] timeconv.pl
- Previous by thread: Re: [tlug] timing for geeks II.
- Next by thread: Re: [tlug] timing for geeks II.
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links