Time based variable

  • Thread starter Thread starter John Bailo
  • Start date Start date
J

John Bailo

I was thinking: a cool thing would be a time based variable.

So, I'm always doing things like:


(a) Set variable to value

(b) do something

(c) check variable and compare to original.


What I really want is a variable that I can set and say

varible(DateTime.Now) - variable(Ten Minutes Ago).

Can generics do this?
 
struct MyType<T>
{
public MyType(T value)
{
this.Value = value;
this.TimeStamp = DateTime.Now;
}

public T Value;
public DateTime TimeStamp;
};
 
Back
Top