From e4c3ae76c1df9a1e3818c5ef7150a940ee17d575 Mon Sep 17 00:00:00 2001 From: David Mayerich Date: Sun, 3 Sep 2017 10:06:53 -0500 Subject: [PATCH] added time estimates to the progress bar --- bimsim.cu | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bimsim.cu b/bimsim.cu index c1c683f..935e3da 100644 --- a/bimsim.cu +++ b/bimsim.cu @@ -92,10 +92,15 @@ void gpu_absorbance(T* A, T* I, T* I0, size_t N){ void progressbar_thread(double* e){ unsigned int p = 0; + std::chrono::system_clock::time_point start = std::chrono::system_clock::now(); //initialize the previous time point + std::chrono::system_clock::time_point now; + std::chrono::duration elapsed, remaining; while(p != 100){ if(*e > p){ + now = std::chrono::system_clock::now(); //get the current time + elapsed = now - start; //calculate the elapsed time p = (unsigned int)(*e); - rtsProgressBar(p); + rtsProgressBar(p, elapsed.count()); } } std::cout<