Minimalist countdown timer with C#
Without more context it's really hard to give you a particularly helpful answer but I can suggest a couple of things.

Your first option is about as bad as it gets, it will thrash CPU because as far as the CPU is concerned that while loop is important work - it doesn't know you're just calculating a time over and over again.

Your second option isn't bad but you should accept an action to run after the delay otherwise it won't be very flexible. You should also use TimeSpan to represent an interval - an int can mean many things, a TimeSpan represents the information unambiguously.

For the sake of completeness, for this trivial example I think it's clearer without the async and await but that's just personal preference.

public static Task DoActionAfter(TimeSpan delay, Action action)
{
    return Task.Delay(delay).ContinueWith(_ =&gt; action());
}


As you're returning a Task your code can synchronously wait using .Wait() (not great) or await the result. If it doesn't need the result straight away it can just store the task and check its status later.

If you want to be able to cancel your action you should feed a CancellationToken into the method (and the delay).

Update

To actually use the method:

using System;
using System.Threading.Tasks;

namespace CountdownTimer
{
    class Program
    {
        public static void Main()
        {
            var delayInterval = TimeSpan.FromMilliseconds(5000);
            var runningTask = DoActionAfter(
                delayInterval,
                () =&gt; Console.WriteLine("Done"));

            // if you want your main method to wait for the action
            // runningTask.Wait()

            Console.ReadKey();
        }

        public static Task DoActionAfter(TimeSpan delay, Action action)
        {
            return Task.Delay(delay).ContinueWith(_ =&gt; action());
        }
    }
}