distance = (duration / 2) * 0.0344;

Redeyatio:
Sound goes slower in a microsecond because it's one millionth of a second.

Sound goes the same speed no matter what units you measure it in.

It travels a smaller DISTANCE in 1 ms than in 1 second.

You have to be clear in your mind what it is that you are measuring if you hope to understand the math.