You're blowing smoke at me now.
Your example was incorrect--if the port register is declared volatile, the compiler is not at liberty to re-order code across sequence points such as the semicolon at the end of the statements. Thus the pin will go high before the 'big calculation' and low afterwards.
Other things that interrupt the program flow (e.g. interrupts and context switches) can make the interval longer, but that would most often occur during the big calculation, so it's a real measurement.
Cheers
Phil Hobbs