Thyme and rosemary are not the same, although they can be used as substitutes for each other if a recipe calls for rosemary and you only have thyme or vice versa.
The main difference which sets thyme and rosemary apart is that rosemary has a stronger and more pungent taste than thyme. Thyme is milder, though they both share woody, floral notes which give them a similar flavor profile.
Both are popular within herbal medicine and are frequently used in culinary dishes, often in combination with one another.