To compare investments of different lengths, you need the compound annual rate. Dividing the total gain by the years ignores that returns build on a changing base.
An example with numbers
Going from $10,000 to $12,100 in two years, with no contributions or withdrawals, is a 21% total gain. The compound annual rate is 10%, because 10,000 × 1.10 × 1.10 = 12,100.
Try it with your numbers
Compare both figures with a one-year investment. If you added money during the period, record the dates and amounts before crediting all the growth to returns.
Example figures for learning purposes. They are not a recommendation and do not replace professional advice.