Working out what percentage time 1 is faster than time 2 with respect to time 2

Feb 2009
13
0
Hey everyone, I'm having a little difficulty with something very basic but the problem is kind of subtle and I'm really afraid of getting it wrong in my report because it's one of those mistakes one can easily miss.
I programmed two versions of some code and time tested them. Let's say for example
Time recorded for method 1 = T1 = 1 second.
Time recorded for method 2 = 3 seconds.

I want to now say 'This is the percentage that method 1 is faster than method 2: '.

How would one go about this?

I'm also open to suggestions of the best way to show how time 1 is faster than 2.
 

HallsofIvy

MHF Helper
Apr 2005
20,249
7,909
Given two numbers, A and B, with A larger than B, the amount that "A is larger than B" is A- B. The "percentage that A is larger than B, with respect to B" is \(\displaystyle \frac{B- A}{B}\) expressed as a percentage. If method 2 takes 3 seconds while method 1 take 1 second then method 1 is 3- 1= 2 seconds faster than method 2. The percentage that method 1 is faster than method 2, as a percentage of method 2 (or "with respect to method 2) is \(\displaystyle \frac{2}{3}= \frac{2}{3}= 0.66666...= 66\frac{2}{3}\%\).
 
  • Like
Reactions: 1 person
Feb 2009
13
0
Okay, thank you very much, now I feel more reassured. Also as a follow up question is my method for comparing the speeds of method 1 and 2 acceptable, as in, would you as a reader find it useful to know that method 1 is 66.6% faster than method 2?