If there is something floating around in the bottom of the tank and sometimes finds its way to partially block the pipe at the bottom of the tank, you will have symptoms like what you describe. The fact that it will eventually restart after a period of time could indicate that the blockage is not complete, allowing some fuel to make it from the tank to the carburetor bowl, allowing the engine to run for a while. I had this happen to me with an old tank.
I did what everyone above is recommending about testing for spark and for squirt of gas form goosing the throttle as soon as the engine dies.
These tests are much easier than trying to determine if you have an intermittent or partial blockage in the tank. Do the other tests to rule them out.