loss question

How long can a company operate without producing a profit and continuing to write off business expenses?