-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtiempo.h
37 lines (33 loc) · 891 Bytes
/
tiempo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include "fifo.h"
#include "lifo.h"
#include "RR.h"
#include <iostream>
#include <chrono>
using namespace std;
using namespace std::chrono;
void correr_algoritmo(int num, microseconds &tiempo)
{
high_resolution_clock::time_point inicio, final;
switch (num)
{
case 0:
inicio = high_resolution_clock::now();
fifo();
final = high_resolution_clock::now();
tiempo = duration_cast<microseconds>(final - inicio);
break;
case 1:
inicio = high_resolution_clock::now();
lifo();
final = high_resolution_clock::now();
tiempo = duration_cast<microseconds>(final - inicio);
break;
case 2:
inicio = high_resolution_clock::now();
RR();
final = high_resolution_clock::now();
tiempo = duration_cast<microseconds>(final - inicio);
break;
}
}