Questions tagged [elapsed]
82 questions
379
votes
10 answers
Measuring elapsed time with the Time module
With the Time module in python is it possible to measure elapsed time? If so, how do I do that?
I need to do this so that if the cursor has been in a widget for a certain duration an event happens.

rectangletangle
- 50,393
- 94
- 205
- 275
90
votes
5 answers
How to format elapsed time from seconds to hours, minutes, seconds and milliseconds in Python?
How can I format the time elapsed from seconds to hours, mins, seconds?
My code:
start = time.time()
... do something
elapsed = (time.time() - start)
Actual Output:
0.232999801636
Desired/Expected output:
00:00:00.23

Boosted_d16
- 13,340
- 35
- 98
- 158
21
votes
1 answer
How to pass parameters to the function called by ElapsedEventHandler?
How to pass parameters to the function called by ElapsedEventHandler?
My code:
private static void InitTimer(int Index)
{
keepAlive[Index] = new Timer();
keepAlive[Index].Interval = 3000;
keepAlive[Index].Elapsed += new…

lesderid
- 3,388
- 8
- 39
- 65
13
votes
6 answers
How to get the time elapsed in C in milliseconds? (Windows)
I've searched in the Web but I've only found a way for do it, but in this way it returns in seconds instead of milliseconds.
My code is:
#include
#include
#include
int main(void)
{
int solucion;
time_t start,…

Kaer
- 351
- 2
- 5
- 14
12
votes
2 answers
Measuring the HTTP response time with requests library in Python. Am I doing it right?
I am trying to induce an artificial delay in the HTTP response from a web application (This is a technique used to do blind SQL Injections). If the below HTTP request is sent from a browser, response from the web server comes back after 3…

user1720897
- 1,216
- 3
- 12
- 27
8
votes
6 answers
Elapsed time of running a C program
I would like to know what lines of C code to add to a program so that it tells me the total time that the program takes to run. I guess there should be counter initialization near the beginning of main and one after the main function ends. Is the…

yCalleecharan
- 4,656
- 11
- 56
- 86
7
votes
4 answers
Measure elapsed time between two MotionEvents in Android
I'm new in Android programming so I am asking for your help in my problem.
I am trying to measure in seconds/milliseconds the amount of time between a MouseEvent.ACTION_DOWN and MouseEvent.ACTION_UP.
@Override
public boolean onTouchEvent(MotionEvent…

Matey
- 107
- 1
- 1
- 4
5
votes
2 answers
Select elapsed time from MySQL
I'm using this query:
SELECT NOW() - date AS elapsed FROM ...
Date column is TIMESTAMP.
It returns 41632 when elapsed time is about 4 hours and 20 minutes.
It's not timestamp.
What is it?
Or is there any better way to get elapsed time and generate…

ucha
- 363
- 2
- 4
- 12
5
votes
0 answers
Measure elapsed time between two events in fluentd
Im looking for a way to measure the elapsed time between to events using fluentd. Also it would be awesome to be able to merge two or more events.
Until now I was using logstash. There are two plugins for my usecase in logstash:
elapsed and…

maigl
- 51
- 2
4
votes
6 answers
elapsed time in C
#include
time_t start,end;
time (&start);
//code here
time (&end);
double dif = difftime (end,start);
printf ("Elasped time is %.2lf seconds.", dif );
I'm getting 0.000 for both start and end times. I'm not understanding the source of…

suzy
- 41
- 1
- 1
- 2
3
votes
4 answers
calculate elapsed time in flash
I am building a quiz and i need to calculate the total time taken to do the quiz.
and i need to display the time taken in HH::MM::SS..any pointers?

hitek
- 372
- 1
- 17
- 33
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
1 answer
Keeping track of elapsed time C#/Unity
I'm creating a rhythm game in C# and Unity, and I haven't been able to find a direct correlation between the problems some of my players are having and their hardware but some of them are having problems with the gameplay gradually desyncing from…

Ryan Foster
- 51
- 1
- 2
3
votes
1 answer
DateTime elapsed in c#?
so I'm trying to display messages in a readOnly textbox, with the elapsed time and date, although I'm having some problems. It's displaying that the message was sent 325 days ago, when really it should be 1 min ago. Could someone please help to tell…

Kirstie Judd
- 55
- 2
- 5
3
votes
6 answers
Converting elapsed milliseconds into proper java date format?
I stuck up in the middle of my development, I have requirement in such a way that i need to find the delay between two dates ie.. currentdate-date from database
and i need to display the delay in the format of dd:hh:mm . After referring lot of…

Esh
- 836
- 5
- 16
- 43