Timeout for Document.Optimize() method?

Is there a way to interrupt or cancel the Document.Optimize() method in .NET library after a certain time? Some very large PDFs cause it to run for hours. Is there a setting or other way to tell it to stop after a set time, e.g. 5 minutes? If not, can you please add a way?

Thank you

@ast3

Please attach your input PDF file here for testing. We will investigate the issue and provide you information on it.