How giant is a "giant text file"? On my machine a 75M file takes roughly 0.12 sec to count the lines (it is dummy data, so not very random).
If GigaBytes in size, then close enough might be good enough I didn't see @cblake mention it, but you could count the bytes to read 100 lines of a big file and use that to estimate the overall number of lines.
