Answering myself,
A solution that worked for me, is to measure the time it takes
to perform each READ from the storage. If the read is under
2milliseconds(appropriate for my H.D) then the read must have
hit the cache (might be the device cache, can't tell). If above
then its very likely its an I/O.
If its under 2ms I perform a for loop to delay execution for 5 more
ms to simulate an i/o.

I am using gettimeofday to find the difference.
Not very reliable but from some experiments,
seem sufficient for most cases.

Regards,
        tzahi.



=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to