1And the people of Israel again did what was evil in the sight of the LORD, so the LORD gave them into the hand of the Philistines for forty years.
The oppression would have lasted roughly from the time of Ammonite uprising (Judges 10:7) to the victory at Mizpeh (1 Samuel 7:7–13), with the battle of Aphek happening at the twenty-year mark (1 Samuel 7:2). So Samson seems to come in halfway.
1 And the people of Israel again did what was evil in the sight of the LORD, so the LORD gave them into the hand of the Philistines for forty years.