Questions tagged [time-measurement]

59 questions
3
votes
1 answer

Reliable short time span measurements on Windows

I need code that will provide "Ticks" of 10 miliseconds exactly and I am buffled in view of the many articles some contradicting others regarding how to accomplish this in Windows. I've managed the first step - using the MultiMedia timer to provide…
Joezer
  • 625
  • 1
  • 9
  • 20
3
votes
2 answers

How to measure the time taken by executing a piece of code in a reliable way?

The question of how to measure execution time has been asked plenty of times on SO, see here or here for example. However these questions mostly focus on which timing functions to use. What I am interested in is how to make the results reproducible.…
vitaut
  • 49,672
  • 25
  • 199
  • 336
2
votes
0 answers

Is System.currentTimeMillis() monotonic in the context of Java Memory Model?

Is there a guarantee, that if one System.currentTimeMillis() call happens before another System.currentTimeMillis() call (from another thread), the value returned from the second call is not less than the value returned from the first call?
leventov
  • 14,760
  • 11
  • 69
  • 98
2
votes
0 answers

Exact Time Measuring for Cognitive Experiments

we have a java program being used for some cognitive diagnosis in which we have to measure time the most exact way possible. till now it has used psychtoolbox to perform these measurements, but since moving from XP to win7 there is a significant…
Spätzle
  • 709
  • 10
  • 20
2
votes
1 answer

program execution time in ARM Cortex-A8 processor

I'm using ARM Cortex-A8 and trying to read the value from CCNT time counter through the assembly code.  I am following this post How to measure program execution time in ARM Cortex-A8 processor? . In accordance with it, before I can read the value…
Irina
  • 149
  • 1
  • 1
  • 12
1
vote
2 answers

R: How to recode a wide data frame with repeating variables (time) into to long data?

My data frame consists of several hundred persons (rows) answering 4 * 90 items each. It’s the same 90 questions across four points in time per person. Each person belongs to one of two groups. I checked for measurement invariance across these…
E_H
  • 131
  • 7
1
vote
1 answer

Measure execution time in different languages

I am working on one project, the purpose of which is to compare sorting algorithms in different languages. My comparisons will be of two types: Comparison based on calendar time Comparison based on processor time I want to know, if i can compare…
Sepi
  • 77
  • 5
1
vote
1 answer

Is there a way to profil an MPI Application during Runtime? - Using the time spent in MPI Calls in runtime

I am wondering if there is a way of measuring the time which is spent in MPI calls during runtime. Thus, I can use it for calculating a new load balancing. I know how to profile and trace the program using some tools from OpenMPI or Intel, but those…
1
vote
5 answers

c# Lock with Thread.Sleep not working

I have the following code. In windows server 2008, the program is correct and runs as expected. It outputs 10 different ids. However, when I run it in windows server 2003, the program is not correct. It outputs 10 ids, but some of the id's are…
Allen Fu
  • 66
  • 1
  • 7
1
vote
1 answer

Time measurement of C program is 0

The following code was run in codeblocks, gcc compiler. #include #include int sumN(int n) { int i,sum; for(i=0; i
this.shivi
  • 301
  • 3
  • 7
1
vote
3 answers

logical time versus physical time in ubuntu linux

i am measuring physical time between two events like this: #include #include timeval wall_time0; timeval wall_time1; // start of period measurement gettimeofday( &wall_time0 , 0); ...stuff happening // end of period…
lurscher
  • 25,930
  • 29
  • 122
  • 185
1
vote
0 answers

How to measure the time difference between two sensors down to the nanosecond?

Similar to laser gates, I am trying to find the time difference between two different trigger sensors. As of now, I am using Arduino UNO, but if there is a different language or processor that could get this precision, I am open to ideas. With the…
1
vote
1 answer

Getting the Time elapse between two arduino in microseconds

I want to measure the time elapsed between my two arduino using rx/tx module in microseconds. I made my codes and I notice that something wrong in my output. I hope you can help me. Both A(device 1) and B(device 2) are responsible for measuring a…
1
vote
2 answers

How do I measure time per thread in C?

I am working on a code with multiple number of threads and I want to print the time it took for me to complete task I assigned the i-th thread to do. Meaning I want to print the time each thread took to be done with the doSomeThing function int…
Kyle
  • 154
  • 1
  • 2
  • 13
1
vote
1 answer

How to organize time invariant checking with D contracts?

For example, I have to assure that a certain function for a certain real-time system works for 20 ms or less. I can simply measure time at the beginning of a function and at the end of it, then assert the difference to be satisfactory. And I do this…
akalenuk
  • 3,815
  • 4
  • 34
  • 56