From: Franck A. <fr...@ne...> - 2008-08-06 21:46:28
|
Müller Gloria: > Something unrelated. I wanted to time my code. Is it really that Eiffel > can only measure time up to a precision of seconds? If I want to time > my code I need at least nanoseconds. "at least"? you know typical CPUs have a frequency of about 2GHz that is 1 cycle is about 0.5 nanoseconds. I don't think anyone needs to measure any kind of high level code at that level of granularity. besides I don't think you can implement that precision, just the operation of taking the measurement (in so far as there is any hardware you can buy that has the capability) and giving it back to you is going to take multiple instructions thus already way above your precision... that said, depending on the application, milliseconds might be useful. > Using command line "time" is inconvenient. and it's not going to give you nanosecond precision either. |