Timers on many objects

Discussion in 'C#' started by imported_markyoung1984, Sep 10, 2010.

  1. imported_markyoung1984

    imported_markyoung1984 New Member

    Joined:
    Sep 10, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi I have about 2000 fairly simple objects stored in a hash table within memory.

    Each object has a date and time it was last accessed and this is stored in a variable. I basically want to access each object every 24 hours. Each object was last accessed at different times of the day so timers will vary. When 24 hours has passed for a certain object I want to start a thread and pass that object (I already know how to do this) to it (ParametizedThreadStart).

    I am really not sure of what I should implement. I know there are timer classes but I have no idea which I would implement or how.

    The only method I can see at the moment for doing this is by creating a thread which constantly loops through the objects in my hash table, comparing the variable in each object that tells me the date/time it was last accessed with the current date/time and calcualting if 24 hours has passed.

    Do you have any recommendations?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice