[Haskell-cafe] Re: Computer time, independent of date

2009-01-12 Thread Mauricio
patients, I wanted to be sure not to save wrong information. It wouldn't matter if the clock is saying we are on XVII century, as long as 10 seconds would never be 10.1. What are the interval durations you need to measure? Since they are from equipment, what is the spec? I read from serial

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-10 Thread Manlio Perillo
Steve Schafer ha scritto: On Fri, 09 Jan 2009 09:28:49 -0600, you wrote: I'm not sure that the original question implied *that* level of need. I can't imagine being worried about leap seconds yet at the same time being willing to accept the potential vagaries of any of the built-in clocks.

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-10 Thread Steve Schafer
On Sat, 10 Jan 2009 15:04:36 +0100, you wrote: POSIX realtime extensions have been developed to be high reliable. I think people are missing the details here. Yes, the built-in real-time clocks have excellent long-term accuracy. They run UTC-based correction algorithms using NTP, and are thus

[Haskell-cafe] Re: Computer time, independent of date

2009-01-10 Thread Mauricio
POSIX realtime extensions have been developed to be high reliable. (...) However, they offer no guarantees on interval measurements, and the correction algorithms can cause the measurement of a time interval of an hour or so duration to be off by +/- 1 sec, especially within the first few hours

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-10 Thread Manlio Perillo
Mauricio ha scritto: POSIX realtime extensions have been developed to be high reliable. (...) However, they offer no guarantees on interval measurements, and the correction algorithms can cause the measurement of a time interval of an hour or so duration to be off by +/- 1 sec, especially

[Haskell-cafe] Re: Computer time, independent of date

2009-01-10 Thread ChrisK
Mauricio wrote: patients, I wanted to be sure not to save wrong information. It wouldn't matter if the clock is saying we are on XVII century, as long as 10 seconds would never be 10.1. Chris (yes I am an experimental physicist) asks: What are the interval durations you need to measure?

[Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Mauricio
benchpress also uses System.CPUTime -- is that what you are looking for? I'm writing a program that will read medical signs from many patients. It's important to have a precise measure of the time interval between some signs, and that can't depend on adjustments of time. (Supose my software is

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Bulat Ziganshin
Hello Mauricio, Friday, January 9, 2009, 4:01:18 PM, you wrote: computer has been turned on would do all I need. Or, maybe, how much has elapsed since the program started. i think you should look into system counters (if you on windows). for example, task managet in vista shows time since

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Cetin Sert
Don't know if it might help but: http://en.wikipedia.org/wiki/RDTSC cabal install rdtsc http://hackage.haskell.org/packages/archive/rdtsc/1.1.1/doc/html/System-CPUTime-Rdtsc.html Regards, CS 2009/1/9 Bulat Ziganshin bulat.zigans...@gmail.com Hello Mauricio, Friday, January 9, 2009, 4:01:18

Re[2]: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Bulat Ziganshin
Hello Cetin, Friday, January 9, 2009, 4:29:04 PM, you wrote: yes, i mean this lib but forget its name :) thank you Don't know if it might help but: http://en.wikipedia.org/wiki/RDTSC cabal install rdtsc

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Manlio Perillo
Mauricio ha scritto: benchpress also uses System.CPUTime -- is that what you are looking for? I'm writing a program that will read medical signs from many patients. It's important to have a precise measure of the time interval between some signs, and that can't depend on adjustments of time.

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Manlio Perillo
Cetin Sert ha scritto: Don't know if it might help but: http://en.wikipedia.org/wiki/RDTSC cabal install rdtsc http://hackage.haskell.org/packages/archive/rdtsc/1.1.1/doc/html/System-CPUTime-Rdtsc.html Note that the use of RDTSC register has some issues on multicore CPU. More info at:

[Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Mauricio
Both wikipedia and hackage rdtsc packages have lot of warnings regarding things I'm not able to control. It seems it doesn't work with many platforms, be it older or multi-core, hibernating computers. yes, i mean this lib but forget its name :) thank you Don't know if it might help but:

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Steve Schafer
On Fri, 09 Jan 2009 11:01:18 -0200, you wrote: I'm writing a program that will read medical signs from many patients. It's important to have a precise measure of the time interval between some signs, and that can't depend on adjustments of time. (Supose my software is running midnight at the end

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread John Goerzen
Steve Schafer wrote: On Fri, 09 Jan 2009 11:01:18 -0200, you wrote: I'm writing a program that will read medical signs from many patients. It's important to have a precise measure of the time interval between some signs, and that can't depend on adjustments of time. (Supose my software is

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Manlio Perillo
John Goerzen ha scritto: Steve Schafer wrote: On Fri, 09 Jan 2009 11:01:18 -0200, you wrote: I'm writing a program that will read medical signs from many patients. It's important to have a precise measure of the time interval between some signs, and that can't depend on adjustments of time.

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Cetin Sert
Here's a basic draft project for clock_gettime(CLOCK_MONOTONIC, ...) http://sert.homedns.org/hs/mnsec/ http://sert.homedns.org/hs/mnsec/dist/mnsec-1.0.0.tar.gz It could be extended to cover other clock types than just monotonic. Regards, CS 2009/1/9 John Goerzen jgoer...@complete.org Steve

[Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Mauricio
Linux has High-Resolution Timers (HRTs) that may be appropriate. See the manpage for clock_gettime(), which defines these HRTs: [...] CLOCK_MONOTONIC, in particular, looks suitable. Using it could be a matter of just a few quick likes in FFI. I don't know if Windows has similar features.

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Steve Schafer
On Fri, 09 Jan 2009 09:28:49 -0600, you wrote: I'm not sure that the original question implied *that* level of need. I can't imagine being worried about leap seconds yet at the same time being willing to accept the potential vagaries of any of the built-in clocks. Steve Schafer Fenestra

[Haskell-cafe] Re: Computer time, independent of date

2009-01-08 Thread Mauricio
Is there an alternative? Something like how much time has passed since the program has started would be great. Have a look at benchpress on hackage. But benchpress uses Data.Time.Clock.getCurrentTime. I understand that is dependent from configuration. It's okay to benchmark a fast

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-08 Thread Martijn van Steenbergen
Mauricio wrote: But benchpress uses Data.Time.Clock.getCurrentTime. I understand that is dependent from configuration. It's okay to benchmark a fast application, but mine will be running for days, so it would not be reliable. benchpress also uses System.CPUTime -- is that what you are looking