public void WaitForFilesToDownload() { Stopwatch sw = new Stopwatch(); sw.Start(); while (sw.Elapsed > TimeSpan.FromSeconds(ConfigManager.WaitTillDownloadIsFinished) || DirectoryManager.CheckIfThereAreUnfinishedDownloads()) { ; } }