Questions tagged [elapsedtime]

The time that elapses while some event is occurring.

Elapsed time is the time or difference between a beginning time and an ending time.

196 questions
178
votes
20 answers

Measure elapsed time in Swift

How can we measure the time elapsed for running a function in Swift? I am trying to display the elapsed time like this: "Elapsed time is .05 seconds". Saw that in Java, we can use System.nanoTime(), are there any equivalent methods available in…
jay
  • 3,517
  • 5
  • 26
  • 44
22
votes
3 answers

System.Timers.Timer How to get the time remaining until Elapse

Using C#, how may I get the time remaining (before the elapse event will occur) from a System.Timers.Timer object? In other words, let say I set the timer interval to 6 hours, but 3 hours later, I want to know how much time is remaining. How would I…
Lonnie Best
  • 9,936
  • 10
  • 57
  • 97
21
votes
8 answers

SQL Server - calculate elapsed time between two datetime stamps in HH:MM:SS format

I have a SQL Server table that has a "Time" column. The table is a log table the houses status messages and timestamps for each message. The log table is inserted into via a batch file. There is an ID column that groups rows together. Each time…
MikeTWebb
  • 9,149
  • 25
  • 93
  • 132
19
votes
2 answers

tkinter and time.sleep

I am trying to delete text inside a text box after waiting 5 seconds, but instead the program wont run and does sleep over everything else. Also is there a way for me to just make my textbox sleep so i can run other code while the text is…
Brandon Nadeau
  • 3,568
  • 13
  • 42
  • 65
10
votes
1 answer

Differences in Elapsed Ticks property of Stopwatch

ElapsedTicks & Elapsed.Ticks are properties of Stopwatch, which I think should be same. And in case they are same, why they should give different outputs ? Code : Stopwatch spwt =…
Pratik
  • 11,534
  • 22
  • 69
  • 99
10
votes
1 answer

Different values for nano time in different sensor data. How to figure them out?

Since the latest Android update (v. 8), I realized a very strange behavior while trying to read sensors. More specifically, I am speaking about WiFi and Cell Towers. Here are two examples: While I read WiFi access point information data and try to…
Moh
  • 1,887
  • 3
  • 18
  • 29
8
votes
1 answer

OpenGL, measuring rendering time on gpu

I have some big performance issues here So I would like to take some measurements on the gpu side. By reading this thread I wrote this code around my draw functions, including the gl error check and the swapBuffers() (auto swapping is indeed…
elect
  • 6,765
  • 10
  • 53
  • 119
7
votes
2 answers

Python - How to calculate the elapsed time since X date?

I have a database table with articles and each one of this articles have a submitted date. I need to calculate the days and hours since the article have been published in the database, like: This article has been published 4 hours ago. This article…
André
  • 24,706
  • 43
  • 121
  • 178
7
votes
3 answers

How get very precise elapsed time C++

I'm running my code on Ubuntu, and I need to get the elapsed time about a function on my program. I need a very accurate time, like nano seconds or at least micro seconds. I read about chrono.h but it uses system time, and I prefer use CPU time. Is…
Teo
  • 3,143
  • 2
  • 29
  • 59
6
votes
1 answer

Measure long elapsed time (with reboots) on Android

I need to measure long elapsed time on Android and there may be device reboots in between. From what I've understand, System.nanoTime() is resetted every time the device reboot, and System.currentTimeMillis() is unreliable because user can change…
dmarcato
  • 872
  • 8
  • 16
5
votes
1 answer

HLS protocol: get absolute elapsed time during a live streaming

I have a very basic question and I didn't get if I googled wrong or if the answer is so simple that I haven't seen it. I'm implementing a web app using hls.js as Javascript library and I need a way to get the absolute elapsed time of a live…
lucataglia
  • 728
  • 5
  • 18
4
votes
3 answers

Correct way to logging elapsed time in C++

I'm doing a article about GPU speed up in cluster environment To do that, I'm programming in CUDA, that is basically a c++ extension. But, as I'm a c# developer I don't know the particularities of c++. There is some concern about logging elapsed…
Custodio
  • 8,594
  • 15
  • 80
  • 115
4
votes
3 answers

Swift - Calculating elapsed time takes too long?

My server call gives me JSON data with a date time per piece of data and I want to calculate the time elapsed between now and then and load it into my data structure. The way I'm doing it now takes way to long, is there a different design practice I…
Sean
  • 51
  • 5
4
votes
1 answer

System.Timers.Timer elapsed event fires too early

I'm running into an issue where the Elapsed event is triggered prior to the interval. I have the interval set for say.. 10000ms and the event will get triggered at roughly 4500ms. I know that this specific timer is not too precise but I do know for…
H. Andrew
  • 61
  • 7
4
votes
1 answer

Cleanest and simplest way to get elapsed time since execution in C++

What is the simplest and cleanest way to get the time since execution of the program (with milliseconds precision) in C++ ? I am making a wave interference simulator to produce Lissajous curves in C++. It requires the time since execution of the…
AvZ
  • 997
  • 3
  • 14
  • 25
1
2 3
13 14