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
4
votes
3 answers

Calculating elasped time between Midnight and current time

I'm trying to determine how many hours, minutes, seconds have passed throughout the day. The timer restarts at midnight for every new day. So if the current time is 2:15 PM, I need to calculate that to be 14 hours and fifteen minutes. I know how to…
tronious
  • 1,547
  • 2
  • 28
  • 45
4
votes
1 answer

CUDA: atomicAdd takes too much time, serializing threads

I have a kernel which makes some comparisons and decides whether two objects collide or not. I want to store the colliding objects' id's to an output buffer. I do not want to have gap in the output buffer. I want to record each collision to a unique…
phoad
  • 1,801
  • 2
  • 20
  • 31
4
votes
3 answers

How do I create a stopwatch Bash script to constantly display elapsed time?

You can think of this like a really simple stopwatch. I'm trying to hack together a bash script that displays the elapsed time since a specified date and updates the output every second. First, Inside the script you'd specify a UNIX date: Fri Apr…
jerzy
  • 2,364
  • 4
  • 20
  • 24
3
votes
3 answers

php mysql time elapsed calculation

I have an app [iphone], that sends to a server some times [using json], so the times look like hh:mm 24 hour format, the time gets saved in the db as varchar, I need to calculate the elapsed time = endTime - startTime but my problem is that I have…
manuelBetancurt
  • 15,428
  • 33
  • 118
  • 216
3
votes
5 answers

How can I find the number of days between two Dates?

I have two Dates. How can I tell the difference between these two dates in days? I have heard of SimpleDateFormat, but I don't know how to use it. I tried this: String fromdate = "Apr 10 2011"; SimpleDateFormat sdf; sdf = new SimpleDateFormat("MMM…
Pavan
  • 93
  • 5
  • 9
3
votes
2 answers

How to pretty-print elapsed times/ETAs in Python?

I am measuring run times of a program in seconds. Depending on the amount of data I input, that can take milliseconds to days. Is there a Python module that I can use to convert the number of seconds to the most useful unit and display that?…
bers
  • 4,817
  • 2
  • 40
  • 59
3
votes
1 answer

elapsed time between the two loops

I want to measure the time difference (inseconds) between two lines of code. while ret: ret, image_np=cap.read() time_1 for condition: if condition: time_2 I want to subtract (time_2) - (time_1). But the problem is…
vaveila
  • 73
  • 4
3
votes
1 answer

Calculating time elasped and putting it in Days:Hours:Minutes:Seconds format in javascript where time elapsed updates every second

I am trying to compute time elapsed between a set date time object and current time. I want it to be able to appear in this format DD:HH:MM:SS where DD is day, HH is Hours, MM is minutes,SS is Seconds.I am able to get the total day, total hours,…
user8964654
  • 87
  • 1
  • 9
3
votes
0 answers

What is the best way to measure elapsed time in Racket?

Following is my quicksort program in Scheme using Racket and I'd like to measure time this program but I cannot find a way to do that. I tried (time(quicksort(list 1 4 3))) but this is not as precise as I expected. Is there any ideal way to do…
A.Lee
  • 69
  • 3
3
votes
1 answer

iPhone - NSDateComponents/NSCalendar and Elapsed time (e.g., Scanned 3 hours ago.)

I'd like to display to the user the following elapsed times: e.g, Scanned 13 seconds ago Scanned 2 minutes ago Scanned 1 hour ago Scanned 2 days ago Scanned 1 month ago Scanned 1 year ago I use the following method to achieve this, however it's not…
gotnull
  • 26,454
  • 22
  • 137
  • 203
3
votes
2 answers

How to convert number of seconds to plain English string with larger units as needed?

My Timestamp To String Function // Timestamp To String function time2string($time) { // DAYS $d = floor($time/86400); if ($d > 0) { $_d = $d.($d > 1 ? ' days' : ' day'); } else { $_d = ""; } // HOURS $h =…
Tyler
  • 854
  • 1
  • 10
  • 26
3
votes
2 answers

Java / Android - Calculate difference between timestamps

I have a problem figuring out how to calculate the elapsed time between two timestamps (hours, minutes, seconds). This is the result: String starttime = beginElement.getTimestamp(); String endtime = element.getTimestamp(); I/Start time:…
Bart Ros
  • 419
  • 5
  • 14
3
votes
0 answers

System.nanoTime() inaccurate on Android?

I've discovered through extensive printf-debugging that System.nanoTime() isn't actually what it purports to be: a monotonically increasing long representing nanoseconds with at least millisecond accuracy. I've made two calls to System.nanoTime()…
MitchellSalad
  • 4,171
  • 8
  • 23
  • 24
3
votes
3 answers

Calculate the elapsed time from a date vb.net?

I need to get the elapsed time from a date, for example: I have this line Mon, 12 Sep 2016 10:20:00 +0100 If the datetime now is: 12/09/2016 10:40:02 And I need to get this as final result: 20 mins ago Another example for the same question to…
Esraa_92
  • 1,558
  • 2
  • 21
  • 48
3
votes
2 answers

Measure time in Java JNI ( native call Java)

I am trying to measure time in JNI call, it call from native to Java. In C code, I apply "GetTickCount" api to get JNI execution time and "System.nano" in Java. Example: long start = GetTickCount(); ....//CallStaticMethod exampleMethod... long end =…
1
2
3
13 14