Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 833641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:32:59+00:00 2026-05-15T04:32:59+00:00

I ask though I doubt there is any such system. Basically I need to

  • 0

I ask though I doubt there is any such system.

Basically I need to schedule tasks to execute at some point in the future (usually no more than a few seconds or possibly minutes from now), and have some way of cancelling that request unless too late.

Ie. code that would look like this:

var x = Scheduler.Schedule(() => SomethingSomething(), TimeSpan.FromSeconds(5));
...
x.Dispose(); // cancels the request

Is there any such system in .NET? Is there anything in TPL that can help me?

I need to run such future-actions from various instances in a system here, and would rather avoid each such class instance to have its own thread and deal with this.

Also note that I don’t want this (or similar, for instance through Tasks):

new Thread(new ThreadStart(() =>
{
    Thread.Sleep(5000);
    SomethingSomething();
})).Start();

There will potentially be a few such tasks to execute, they don’t need to be executed in any particular order, except for close to their deadline, and it isn’t vital that they have anything like a realtime performance concept. I just want to avoid spinning up a separate thread for each such action.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:33:00+00:00Added an answer on May 15, 2026 at 4:33 am

    Since you don’t want to have external reference, you might want to have a look at System.Threading.Timer, or System.Timers.Timer. Note that those classes are technically very different from the WinForms Timer component.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought there was a way to quickly ask a NSSet to poll its
I'm new here. I thought I could ask for some help here on my
This question is related to an existing question I asked. I though I'll ask
though I haven't worked with sockets professionally, I find them interesting. I read some
these are the some silly question ..i want to ask..please help me to comprehend
I know, poorly worded question not sure how else to ask though. I always
I'm going to ask this question using Scala syntax, even though the question is
I dont know on which tag i need to ask this question. I'm currently
We received a sharepoint backup file as part of a project. Is there any
Here is what I want to ask: I want to make a system to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.