Best practice for throwing timeout

Keywords: c#


I have a long running task, if the task goes for say more than 10seconds I want to cancel the task , and stop the execution and move to next API call .

What is the best way to implement it. I saw some answers using timers.