Time based variable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Bailo

    #1

    Time based variable


    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(DateTim e.Now) - variable(Ten Minutes Ago).

    Can generics do this?

    --
    Texeme Textcasting Technology



  • KH

    #2
    RE: Time based variable

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

    public T Value;
    public DateTime TimeStamp;
    };



    "John Bailo" wrote:
    [color=blue]
    >
    > 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(DateTim e.Now) - variable(Ten Minutes Ago).
    >
    > Can generics do this?
    >
    > --
    > Texeme Textcasting Technology
    > http://texeme.com
    >
    >
    >[/color]

    Comment

    Working...