Prof Michael Dickinson of the California Institute of Technology in Pasadena took high-speed digital video of fruit flies to find out how they dodge swatters.

In the journal Current Biology he and graduate student Gwyneth Card describe how the creature's pinpoint sized brain is hard wired to turn the looming shadow of a swatter into an appropriate pattern of leg and body motion for a getaway within 100 thousandths of a second.

He says that he has studied other fly species and believes this escape behaviour is shared by them too, being ancient. "Insects have been worried about things like spiders and birds for quite some time."

In the light of his investigations, he shares his top tips on how to swat them with Telegraph readers:

1) Resist in-flight swatting. The housefly is the Ferrari of the insect world and can change course in as little as 30 thousandths of a second.

2) Sneak up. "You want to position the swatter slowly, before the final flick."

3) Approach from behind: although the fly can see behind itself it is not quite a 360-degree field of view, so you are at an advantage with a rearguard action. "When you have the choice, it is a little better to come at the flies from behind."

4) Use a stealth swatter, one that does not contrast much with the background. "The swatter should be as colour neutral as possible," says Prof Dickinson. "Not a dark swatter or a bright one, because the fly can see them more easily. "

5) In the new study, he has found that, long before the fly leaps, its tiny brain calculates the location of the impending threat, comes up with an escape plan, and plonks its legs in an optimal position for takeoff in the opposite direction.

Assuming the fly will to travel away from you, aim beyond the insect. "The fly is going to be flying away from your swatter, so you want to anticipate that and swat beyond the fly."

Prof Dickinson has been studying fly aerodynamics for two decades and says he is now fed up being asked how to kill them. "