Why isn"t there multiply operator for TimeSpan?

Why isn"t there multiply operator for TimeSpan?

am 31.01.2008 15:07:19 von 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.

Re: Why isn"t there multiply operator for TimeSpan?

am 31.01.2008 15:16:56 von Marc Gravell

See here for a similar conversation:
http://groups.google.co.uk/group/microsoft.public.dotnet.lan guages.csharp/browse_thread/thread/828d5b8de352a113/2b3f24d5 da0b1bdf

Marc

Re: Why isn"t there multiply operator for TimeSpan?

am 01.02.2008 05:40:07 von NoSpamMgbworld

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!
|
*************************************************
"Israel" wrote in message
news:0d81642b-2e90-4dff-a4f7-b3c0872887b3@f47g2000hsd.google groups.com...
> 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.
>

Re: Why isn"t there multiply operator for TimeSpan?

am 01.02.2008 08:06:59 von skeet

Cowboy (Gregory A. Beamer) wrote:
> 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.

--
Jon Skeet -
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk