"Redundancy" - the time spent cleaning, along with any unnecessary cleaning actions - didn't differ between the groups, however.
Dr Shaver said the findings appeared to follow other research which showed individuals experiencing anxiety from a complex, uncontrollable or unpredictable task could enter a kind of chaos in the mind stemming from uncertainty about the future.
"Put simply, anxiety and stress lead to a decreased feeling of control," he said.
"To cope with this instability, ritualised behaviour is enacted - [that is], repetitive and predictable actions that aim to increase the feeling of environmental certainty."
The group's hand-movements were monitored using advanced motion-capture technology.
The researchers also collected data from the participants on their perceived anxiety levels, and the difference in their heart rates before and during the cleaning task.
"Repetitiveness and rigidity could be predicted from both heart-rate and the participants' self-perceived anxiety," Dr Shavers said. "However, redundancy could be only mildly attributed to the latter."
It is hoped the research will help better understand conditions such as obsessive-compulsive disorder and autism, as well as more-complex ritualised behaviours, such as those performed by gamblers, athletes, or participants of religious ceremonies.
The research was published in the prestigious academic journal Current Biology.