33 lines
835 B
C++
33 lines
835 B
C++
#include <chrono>
|
|
#include <iostream>
|
|
|
|
#include "../econSpd.h"
|
|
|
|
int main() {
|
|
float altitude;
|
|
float weight;
|
|
int tipTankPercent;
|
|
int ci;
|
|
|
|
// Get data
|
|
|
|
std::cout << "Altitude (ft, no FL)?: ";
|
|
std::cin >> altitude;
|
|
|
|
std::cout << "Weight (kg, no t)?: ";
|
|
std::cin >> weight;
|
|
|
|
std::cout << "Total fuel (kg, not t)?: ";
|
|
std::cin >> tipTankPercent;
|
|
|
|
std::cout << "CI (0 to 999)?: ";
|
|
std::cin >> ci;
|
|
|
|
auto start = std::chrono::high_resolution_clock::now();
|
|
float aioMach = ci2mach(altitude, weight, tipTankPercent, ci);
|
|
auto stop = std::chrono::high_resolution_clock::now();
|
|
auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start);
|
|
|
|
std::cout << "Mach for CI " << ci << ": " << aioMach << std::endl << std::endl;
|
|
std::cout << "Took " << duration.count() << "ns" << std::endl ;
|
|
} |