#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <math.h>
/*
Development Board : Arduino Uno
Student : Maather Mohammed
Student ID : 202413275
*/
// LCD configuration (I2C address 0x27)
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
// Prepare the LCD for displaying information
lcd.init();
lcd.backlight();
// Save the starting time of the benchmark
unsigned long startTime = millis();
// Variable used to store calculation results
volatile float result = 0;
// Execute the mathematical benchmark
for (int i = 1; i <= 5000; i++) {
result += sqrt(i) * sin(i);
}
// Calculate the elapsed execution time
unsigned long duration = millis() - startTime;
// Display benchmark information
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Maather Mohammed");
lcd.setCursor(0,1);
lcd.print("Time: ");
lcd.print(duration);
lcd.print(" ms");
}
void loop() {
// Nothing is repeated after setup()
}