C++/CLI the fastest compiler? Yes, at least for me. :-)

  • Thread starter Thread starter Don Kim
  • Start date Start date
This is very useful info. It was causing confusion given mixed
information coming from MSFT itself.
 
"Carl Daniel [VC++ MVP]" <[email protected]>
wrote in message | | > Followup.
| > !!! Stopwatch.Elapsed.Ticks != Stopwatch.ElapsedTicks !!!
|
| A ha! I obviously hadn't looked at the code closely enough to realize
that
| it was using Elapsed.Ticks and not ElapsedTicks.
|
| > One should not use Elapsed.Ticks to calculate the elapsed time in
| > nanoseconds.
|
| True - one should use it to calculate the elapsed time in 0.1us units,
since
| that's what TimeSpan.Ticks is expressed as.
|
| > The only correct way to get this high precision count is by using
| > Stopwatch.ElapsedTicks like this:
| >
| > long nanosecPerTick = (1000L*1000L*1000L) / Stopwatch.Frequency;
|
| but make this a double. Stopwatch.Frequency is more than 1E9 on modern
| machines using the MP HAL.
|
| double nanosecPerTick = 1000.0 * 1000L * 1000L / Stopwatch.Frequency;
|


Sure, or use picoseconds :-)

long picosecPerTick = 1000L * 1000L * 1000L * 1000L / Stopwatch.Frequency;

90614831400 picoseconds
Looks real crazy isn't it?


Willy.
 
| This is very useful info. It was causing confusion given mixed
| information coming from MSFT itself.
|
| --------
| Ajay Kalra
| (e-mail address removed)
|

Well, the C++/CLI team did not want to generate explicit sequence points in
the IL, so the JIT compiler can only rely on the implicit sequence points
(that is when the evaluation stack is empty). That means also that it's not
possible to synchronise the IL with the actual code while debugging C++/CLI
in managed mode and you need the PDB to set breakpoint in your code, not a
big deal IMO.


Willy.
 
Willy Denoyette said:
Sure, or use picoseconds :-)

Nah - that's short sighted. Let's standardize on Attoseconds :)

long attosecPerTick = 1000L * 1000L * 1000L * 1000L * 1000L * 1000L
/Stopwatch.Frequency;

now that's just getting silly... for the next few decades at least.

-cd
 
"Carl Daniel [VC++ MVP]" <[email protected]>
wrote in message | | > Sure, or use picoseconds :-)
|
| Nah - that's short sighted. Let's standardize on Attoseconds :)
|
| long attosecPerTick = 1000L * 1000L * 1000L * 1000L * 1000L * 1000L
| /Stopwatch.Frequency;
|
| now that's just getting silly... for the next few decades at least.
|
| -cd
|
|

LOL, I'll keep it in mind for a next life maybe :-)

Willy.
 
Back
Top