Melt butter. Cook onions on low heat for 35-40 minutes, stirring occasionally, until deep golden brown. Add sugar halfway through.