The function of elastic on a swimsuit is to hold the garment edges to your body while you move, hopefully without cutting into your skin.
In sewing swimsuits and underwear I used to do the technique where you measure your leg and subtract a few inches for your elastic length. Then sew the elastic into a loop and pin it in quarters onto the inside of the leg opening. This worked for getting the elastic on the leg evenly but actually failed to function properly at holding my swimsuit in place and looking nice.
Elastic actually only need to be tight in the lower crotch area, between your legs. This is the spot where you want full security and no gaping when you move, sit, squat, climb stairs, play volleyball or whatever. Tight elastic on your butt or thigh cuts in to the flesh making your suit look too small or you look too big no matter what size you are. Plus your suit will lay so much nicer if the fabric isn't being gathered by elastic in those areas. Think nice smooth curves!
I've found a better way. Like most techniques it requires a little practice but it really pays off. It's all about redistributing the stretch of the leg openings to where you need it. To attach elastic you can use a serger or zigzag. I prefer zigzag for easier control and serger for speed. I always remember to exercise my elastic before I use it, stretching it out at least three or four times. I mark on my suit about two inches on either side of the bottom crotch seam, you will need to experiment to determine how much to mark since we're all different sizes.
Start sewing your elastic outside this area stretching it just slightly as you sew. If you leave a small lip of fabric on the edge of the elastic the stitching will tend to curl that fabric up over the edge creating a very nice finished look when you turn it under and top stitch. When you approach your mark give it some good stretch. I usually stretch it to the maximum so this area really cinches in. Resume light tension when the other mark is reached. When I meet up with the other end of elastic I cut off so that the raw ends match up with NO overlap. I then zigzag the ends together which creates a flat transition and no lump on the outside.
If you practice you'll notice that even though you don't measure the same length of elastic for each leg both legs will match. Turn your elastic under and top stitch while stretching as necessary. I like to stitch from the back so I can sew exactly on the edge of the elastic.