Despite the progress and innovation of new methods in the field of extracting and processing pharmaceutically active compounds (PhACs), the distillation technique which has a long history combined with scientific progress and evolution, is still considered an innovative technological approach. Productivity, quality, and sustainability are its main indicators. This study was conducted to determine the optimal extraction time and draw the biochemical profile of compounds using gas chromatography-mass spectrometry analysis at different extraction times. Melissa officinalis was selected as a widely used medicinal species in the food and pharmaceutical industries. Data analysis revealed a significant difference in essential oil content at various extraction times. The maximum (0.33% v/w) and minimum (0.25% v/w) extraction efficiency was observed at 180 and 240 minutes, respectively. In total, 62 chemical compounds were isolated in different treatments, with 58 compounds identified. Geranial, neral and citronellal were the main indicators of effectiveness, comprising total of 77.1%, with the highest levels found in the 180-minute treatment. In terms of compound class, oxygenated monoterpenes decreased as extraction time increased. After observing and analyzing the results, it can be determined that the ideal distillation time for this and similar species is 180 minutes. This timeframe not only ensures maximum metabolite yield and high-quality products, but also helps prevent the unnecessary waste of consumable inputs and energy during the extraction process. This finding can serve as a valuable reference point for the production of food and pharmaceutical items.