K
K
kid-programmer2015-09-12 20:45:44
Software testing
kid-programmer, 2015-09-12 20:45:44

How to test latency?

I'm trying to learn TDD and I don't understand how to test the time delay... For example, we send a button press to the window and wait 10 seconds... how can we test it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Arxont, 2015-09-13
@arxont

Use
1. System.Timers.Timer
2. System.Windows.Forms.Timer
3. System.Threading.Timer
It's best not to use Thread.Sleep, as this will completely block the thread and prevent it from processing other messages.
Assuming that you have a single-threaded application (and they are the majority), your application will stop responding to all requests, and not just stop for a while, as you might think.
You can use System.Diagnostics.Stopwatct to control how long it actually took.

D
Dmitry Kovalsky, 2015-09-12
@dmitryKovalskiy

You can call Thread.Sleep() .

J
jackroll, 2015-09-13
@jackroll

System.Diagnostics.Stopwatch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question