The adverbials hardly, scarcely, barely and no sooner are often used to emphasise that one event quickly followed another. If hardly, scarcely, barely and no sooner are in the initial position, the subject and auxiliary are inverted. We usually use the past perfect tense for the verb describing the earlier event. We don’t use Hardly, scarcely, and rarely with negative constructions. Thus, it is wrong to say I couldn’t hardly speak to him but correct to say I could hardly speak to him:
Notice that hardly, scarcely and barely are followed by when, while no sooner is followed by than.
Hardly had I finished the long divisions when the examiner took my answer sheet away.
Scarcely had he boarded the train when the whistle sounded and the train gave a bump.
Barely had he arrived home when his wife began to whine about how hard she had been forced to do household chores.
Hardly had the party begun when the police raided the pub.
No sooner… than
No sooner had his new novel come into the market than it flew off the shelves.
No sooner had the referee’s whistle come than the celebrations began at the stalls.
No sooner had she realized that she had made a mistake than she apologised.
No sooner had he taken the meal out of the oven than someone knocked at the door.