Broccoli and carrots take the same amount of time to cook if they're cut into similar-sized pieces. For example, if roasting, you can cut the carrots into smaller sticks or coins to match the cooking time of the broccoli florets. Always keep an eye on the vegetables while cooking to avoid overcooking or undercooking them.