I don’t know if it’s because we’re embarrassed or because we simply don’t know how to explain it, but the feeling that you’re about to fall asleep isn’t so much marked by a sense of ‘drifting’ as it is an abstract thought process.

Lying there, you’ll suddenly become aware of a bizarre cognition you have had, a sort-of pre-sleep dream.

For many of us, it will come as a comfort, a reassurance that sleep’s soft embrace is imminent, but for Franz Kafka, it was an inspiration to write.

In his diaries, he wrote: "...again it was the power of my dreams, shining forth into wakefulness even before I fall asleep, which did not let me sleep."

Italian doctor Antonio Perciaccante has been studying Kafka’s insomnia and its effect on his work, and shared some of his findings with ResearchGate this week.

Of that passage in question, he concludes: “This seems to be a clear description of a hypnagogic hallucination, a vivid visual hallucination experienced just before the sleep onset.”

Sleep and lack thereof is of course a central theme in Kafka's best known work, Metamorphosis, and plays on protagonist Gregor’s mind. It seems there was a strong dose of autobiography at play.

“Kafka himself affirmed that writing in a sleep-deprived state provides access to otherwise inaccessible thoughts,” Perciaccante explained.

“He said of the experience, '... how easily everything can be said as if a great fire had been prepared for all these things in which the strangest thoughts emerge and again disappear.' Of his own role in the process he remarked, 'all I possess are certain powers which, at a depth almost inaccessible at normal conditions, shape themselves into literature.'"