In most implementations, the fseek
call is almost free since all it does is set the position in the FILE
object. The cost will be incurred when you actually read data. At that point, it is very likely that rereading an already read block will benefit from the buffer cache. But it is also quite possible that the OS is doing speculative read-ahead so that blocks following recently read blocks are also in the buffer cache (as could be the case with your second seek).
For writing, measuring times is even more complicated because the blocks written are not necessarily committed immediately to permanent storage; the write
system call returns as soon as the data has been copied into the buffer cache.