Last active
March 16, 2024 02:24
-
-
Save joaquimnetocel/01e7621516f3a4b76def5aeb90986955 to your computer and use it in GitHub Desktop.
R SPEED TEST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numberStartTime = Sys.time() | |
functionCalculateRoots = function(argA, argB, argC){ | |
numberDelta = argB^2 - 4*argA*argC | |
numberFirstRoot = (-argB + sqrt(numberDelta))/2*argA | |
numberSecondRoot = (-argB -sqrt(numberDelta))/2*argA | |
return (c(numberFirstRoot,numberSecondRoot)) | |
} | |
for (i in 1:200000000){ | |
functionCalculateRoots(2,5,1) | |
} | |
numberEndTime = Sys.time() | |
numberEndTime - numberStartTime |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment