Cook the spaghetti first. Chop the onions and garlic and sauté in olive oil with a few leaves of basil. Add the cooked pasta and sauté for a few minutes over high heat. Add the diced tomatoes and feta. Sauté over medium heat until the cheese is well blended.
Season with salt and pepper to taste.
The whole thing goes even faster if you use the recipe to recycle leftover spaghetti.