It looks quite a lot like winter savoury, Satureja montana, to me. Have you tried tasting it (assuming you're willing to take the risk that it is edible)? Thyme and rosemary have quite distinct flavours. Winter savoury is peppery and slightly bitter.
EDIT: I've added a picture of a plant that was sold to me as 'winter savoury' by a good garden centre in the UK (but I don't have the Latin name from the garden centre). I think it looks a lot like your pictures. My plant tastes peppery, but I could also believe that it had some thyme flavour to it (but that would also fit with the description of Satureja montana).
However, I agree that the flowers here look more like other pictures online of Thymus pulegiodes - Satureja montana can have purple flowers but in other pictures online they appear to be distributed all the way up the stem (more akin to rosemary). So perhaps my plant was misdescribed by the garden centre, or perhaps the same common name is sometimes applied to both plants.
On the whole, I would tend to agree that it is Thymus pulegiodes.