cでタイムアウトメカニズムを実装しようとしています。特定の関数を 15 秒間実行したいのですが、実行時間が 15 秒を超えた場合、プログラムは終了する必要があります。
例えば:
void somefunction()
{
//------------
}
void main()
{
somefunction();//this function should have execution time of 30 seconds.
//If it takes more than 30 seconds it should timeout and pop and error.
}