Why isn't there multiply operator for TimeSpan?

  • Thread starter Thread starter Israel
  • Start date Start date
I

Israel

I've run across many situations where I want to store the time delta
as a TimeSpan (e.g. sampling interval) and then I want to skip every
3rd sample so I want to multiple the delta by the int 3 but I'm forced
to multiple the ticks by 3 and then construct a new TimeSpan with the
resultant ticks.
 
Most likely because a TimeSpan is a DateTime object. Although it can be
expressed as a straight number, it is not internally represented that way.
It could also be that your need was not envisioned.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
 
Cowboy (Gregory A. Beamer) said:
Most likely because a TimeSpan is a DateTime object. Although it can be
expressed as a straight number, it is not internally represented that way.
It could also be that your need was not envisioned.

No, a TimeSpan isn't a DateTime object, and internally it *is*
represented as a number - an Int64.
 
Back
Top