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

  • SEARCH
  • Home
  • 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 8959669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:29:34+00:00 2026-06-15T15:29:34+00:00

I want to delay the response of my website authentication request so that the

  • 0

I want to delay the response of my website authentication request so that the server begins responding at a particular seconds offset from when the request was received.

For example, if the user authenticates at 04:00:00, I want the response to come back at 04:00:05, not sooner nor later. If it is not possible for the code to meet the deadline, I want it to cause an error.

This must be done on the server side and I would like to avoid using Thread.Sleep. Though, I was thinking there may be a way to do this with an async controller and using Thread.Sleep in part of the request’s continuation

Has anyone here faced a similar challenge and what was your solution?

Can any of you folks think of a way to do this while avoiding Thread.Sleep and maintaining responsiveness?

  • 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-06-15T15:29:36+00:00Added an answer on June 15, 2026 at 3:29 pm

    You can use a custom ActionFilters.

    • Record the time the request arrived in the OnActionExecuting method.
    • Then on the OnResultExecuted method inspect the result. If it is a valid response let it through, if it is a not authorized response delay it using Thread.Sleep with the desired delay based on the start time recorded.

    Just make sure your filter runs before the authorization filter ([Authorize] ?) or is registered before it if you’re using global filters and not attributes.

    In this way the delay has no impact on authorized users which I assume is the reason you don’t want to use Thread.Sleep. Note that Thread.Sleep by default is not very accurate (on the order of 20ms), but network latency to the client should obscure that.

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

Sidebar

Related Questions

I want to delay an animation that slides an image in a li a-element.
I want to delay things like the css from happening but this method wont
Essentially I want the text to fadeIn,delay for a 3 seconds and then fadeOut.
Is there a way to delay an ajax request from executing until an animation
I would like to manage requests. Exactly I want delay response for some requests
I want to measure time in miliseconds, that this line took: before=datetime.datetime.now() response =
Here is my problem: http://testepi.kvalitne.cz/test/ I do not want the delay between a keypress
How can I use variables to set my timer? I want to control delay
I want to program a 3 second delay when the form is submitted. Right
I want code for keeping 1 second delay in Flex. i.e. i want 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.