The research could help police identify drivers in road crashes who are suspected of falling asleep at the wheel or driving while drowsy.

It could also assist employers in assessing fitness for duty, such as in the aviation sector or road haulage industry.

Previous research in this area from the AAA Foundation for Traffic Safety has shown that drivers who get just one to two hours less than the recommended daily allowance in a 24-hour period nearly double their risk for a car crash.

The test has been developed at the University of Surrey’s Sleep Research Centre where 36 participants in the study were asked to skip one night of sleep.

During this 40-hour period of sleep deprivation, blood samples were taken and changes in the expression levels of thousands of genes were measured.

A machine learning algorithm identified a subset of 68 genes and with 92% accuracy could detect whether a sample was from a sleep-deprived or well-rested individual.

Dr Emma Laing, Senior Lecturer in Bioinformatics at the University of Surrey, said: “We all know that insufficient sleep poses a significant risk to our physical and mental health, particularly over a period of time.

“However, it is difficult to independently assess how much sleep a person has had, making it difficult for the police to know if drivers were fit to drive, or for employers to know if staff are fit for work.”

Simon Archer, Professor of Molecular Biology of Sleep at the University of Surrey, said: “Identifying these biomarkers is the first step to developing a test which can accurately calculate how much sleep an individual has had.

Professor Derk-Jan Dijk, the director of the Surrey Sleep Research Centre and the lead investigator in the study, added: “This is a test for acute total sleep loss; the next step is to identify biomarkers for chronic insufficient sleep, which we know to be associated with adverse health outcomes.”

Chris McClellan from RAM Tracking, said: “This is a welcome intervention where the safety and well-being of all drivers is concerned. The fast-moving dynamics of working life mean that employers especially have a duty of care to ensure that where possible, their drivers are alert and fully able to carry out their duties. While vehicle tracking devices allow for the monitoring of driver whereabouts and provides the ability to react quickly if someone has an accident; however, these rigorous tests ensure that drivers are alert enough to be on the road can only be a good thing, by both  addressing the risk of tired motorists at source, and encouraging more awareness of the issue as a result.”