Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Measure Event Recognition Latency Part 1: determine typical delays on your own computer, i.e . Repeat the latency measurement over 10,000 iterations. Determine the maximum

Measure Event Recognition Latency

Part 1:

determine typical delays on your own computer, i.e

. Repeat the latency measurement over 10,000 iterations.

Determine the maximum latency value measured.

Calculate the total number of measurements x with

o 5 < x < 100 [ms] and

o x >= 100 [ms]

Part 2:

Repeat the above experiment, but this time try deliberately to make the results worse, for example by increasing / maximising the overall CPU load. If needed you can slow down your computer speed (by reducing the clock frequency, or by disabling cores), but please document all changes

Task:

Create a short report summarising :

  • the computer system (CPU / Memory / Clock / OS) you were using in your experiments,

your results between part 1 and part 2,

what worked best for you in part 2 and why.

Note that the DELAY parameter in the example code can be improved to conduct the experiments quicker.

Sample code:

//This rather crude program emulates the timeline of actions of an airbag control system. It tries repeatedly to detect the moment of impact, which happens at a deterministic point of time, and calculates the latency in this event detection.

import java.util.Date;

public class EventLatencyExperiment {

public static final long DELAY = 100;

public static void main(String[] args) {

long time_ref, time_now, iter = 0, max_latency = 0, diff, latency;

Date date1, date2;

System.out.println("Program started... Wait for impact...");

while (true) {

iter++;

date1 = new Date();

time_ref = date1.getTime();

// DELAY ms from now on the impact will happen.

// How exactly can be capture this event?

do {

date2 = new Date();

time_now = date2.getTime();

diff = time_now - time_ref;

} while (diff < DELAY);

// The impact has occured. Did we capture (and subsequently react)

// on it when it actually happen, or is there a latency = (diff - DELAY)?

// A latency >= 100 ms will most likely kill the person, while a

// latency >= 5 ms can seriously harm her.

// Latencies <= 5 ms are tolerable

latency = diff - DELAY;

// Here we record the maximimum measured latency

if (max_latency < latency) {

max_latency = latency;

}

if (latency >= 100)

System.out.println("Iteration " + iter + " - Impact recognition latency: " + latency + " (ms) --> Passenger likely to be killed!");

else if (latency >= 5)

System.out.println("Iteration " + iter + " - Impact recognition latency: " + latency + " (ms) --> Passenger likely to be seriously harmed!");

}

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+ 9. You have two roommates who invest in the stock market.

Answered: 1 week ago