Not enough information.
What has happened is not paying enough attention, grip slips and throttle rolls off. You said it lasted only a second. The what happened, did the bike surge forward and regain its previous speed? If not, I bet your hand loosened its grip otherwise the throttle position remaining the same would cause the bike to surge forward immediately.
This can also happen if you try to change your hand position when riding at a steady speed. The throttle slips as you try to roll the throttle to maintain speed but change your grip and it seems like the engine just shut off for a second.