Try:
...
Random r = new Random();
int questionNumber = r.Next(0, numberOfQuestions);
AskQuestion(questionNumber);
Timer t = new Timer();
t.Interval = 10000;
t.Elapsed+=new ElapsedEventHandler(OnTimedEvent);
t.Start();
...
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
Timer t = source as Timer;
if (t != null)
{
t.Stop();
}
FailedToAnswerInTime();
}
There are some details, like keeping the Random object as part of your class to ensure it is different each time, making sure you don't ask teh same question twice in a session, etc. But those you can handle with a bit of thought.