Only if you are dealing with a regular octagon. In an irregular octagon, the sides may be different lengths, so you must add each side individually to get the proper measurement.