Is there any way to time out a method after some time if it does not return result without using asynchronous programming?

If it cant be done without asynchronous programming ,Please give me the asynchronous solution but the former is preferred.

```
static void Main(string[] args){
string s=function(string filename); //want to time this out in 10 secs if does not return result
 }

 public string function(string filename){
 //code placed here to ftp a file and return as string
 //i know .net ftp library has its own timeouts, but i am not sure if they are that trust worthy

}

```