Questions tagged [timing]

timing is a numerical measurement of the how long it takes to execute an instruction or series of instructions

Timing is a numerical measurement of the how long it takes to execute an instruction or series of instructions. See also .

To get a better understanding of performance of a given code, it should be measured at several problem sizes and empirical orders of growth calculated.

1396 questions
-1
votes
1 answer

Python timing problem when call a function in another

I have the code below : def update_contact_from_crm_to_import_in_365(): sql = "SELECT * FROM CRM_PRIMARY WHERE copy_to_365 = 'To update' ORDER BY CRM_PRIMARY.id DESC" search_result = my_cursor.execute(sql) search_result =…
Nico44044
  • 125
  • 8
-1
votes
1 answer

Time testing problem for sorting methods using random numbers and arrays

I have working code for sort methods with time analysis code in the end, but can't figure out where to put the random number or array generator code for the sort methods. I get errors each time I try, hopefully someone can show me how it looks when…
JavaNub
  • 13
  • 4
-1
votes
1 answer

Trying to get this to wait 1 second between readings (C++ Arduino)

I have the following code to record temperature in a place and print the data but i want it to wait 1 second in between measurements. How can i do this? (C++ arduino Uno) int sensePin = A0; //TMP36 is plugged into pin A0 int sensorInput; //used to…
-1
votes
1 answer

What options do I have for running recurring events on a microsecond resolution from a kernel driver?

I want to create a simulation of an actual device on an x86 Linux Kernel. Part of this will involve simulating timings as close to possible as I can get. Based on some research it seems I will need at least microsecond resolution timing. I…
James Parsons
  • 6,097
  • 12
  • 68
  • 108
-1
votes
1 answer

What's the correct way to schedule many tasks for an accurate duration later?

My end goal is to schedule many similar tasks to run repeatedly with a consistent period, and have them spread across their period to avoid CPU demand spikes. For the first step, I've tried finding the right way to schedule tasks to run an exact…
igk
  • 41
  • 11
-1
votes
2 answers

Fixing the performance time of algorithm

The following program is created to to calculate the perfect power of numbers The end result is to have the Perfect Power complete all test cases in under .01s of elapsed execution time. Currently the program end result time performance is at about…
Kale_Kyle
  • 1
  • 4
-1
votes
1 answer

How to implement delays in microcontroller firmware

I am programming a Texas Instruments TMS320F28335 Digital Signal Controller (DSC) and I am writing the communication with a resolver model AD2S1205 (datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD2S1205.pdf). I have…
Ingen
  • 19
  • 3
-1
votes
2 answers

Python string comparison doesn't short circuit?

The usual saying is that string comparison must be done in constant time when checking things like password or hashes, and thus, it is recommended to avoid a == b. However, I run the follow script and the results don't support the hypothesis that…
Geekingfrog
  • 191
  • 1
  • 8
-1
votes
1 answer

Vivado: setting timing constraints for input and output delay, simulation mismatch and wrong clock behavior

I'm implementing a hashing algorithm in Verilog using Vivado 2019.2.1. Everything (including synthesis and implementation) worked quite well but I noticed recently that the results of the behavioral simulation (correct hash digest) differs from the…
Johannes
  • 1,478
  • 1
  • 12
  • 28
-1
votes
2 answers

How should be the HTTP timing?

This is the graph of one of my sites https://www.alebalweb-blog.com, first line of firefox development tools -> Network, and I'm not sure that the blocked and waiting entries are "normal". Waiting, I suspect it's the server's fault, it's a small…
alebal
  • 5,838
  • 3
  • 10
  • 28
-1
votes
2 answers

Create time between execution of 2 functions(plain javascript)

I want to have a set amount of time between my explosion function and the reset function, if I don't have a set amount of time, the code quickly executes the reset function after the execution function. This makes the explosion basically invisible.…
Crupeng
  • 317
  • 2
  • 14
-1
votes
2 answers

Clock function returns zero time difference

The following program prints out duration=0.000000000000000000 for some reason. I've read a very similar question The C `clock()` function just returns a zero , but suggestions there didn't help. The loop between which i take time samples is of 100…
-1
votes
2 answers

if a variable's value have not changed for last 24 hours

I want to run a method which sends notification e mail to users in java. But how can I tell the program "run the method if variable's value haven't changed for last 24 hours" ?
-1
votes
1 answer

Unexpected behaviour of pthread_cond_broadcast

Building on my question from yesterday, here, I wrote a small code sample that starts a number of counting and a number of waiting threads. The waiting threads are stopped pthread_cond_wait until they receive a signal. The signal is sent after the…
Imago
  • 521
  • 6
  • 29
-1
votes
1 answer

python stopwatch in IF ELSE

I try to insert stopwatch in my python code. Code read data from API, and if is value bigger then "3" switch relay to ON ( raspberry Pi3 ). This is read every XXX minutes. I want print time how long it's relay on or off. while True: ts =…
McDam
  • 25
  • 5