Skip to content

Instantly share code, notes, and snippets.

@joaquimnetocel
Last active March 16, 2024 02:24
Show Gist options
  • Save joaquimnetocel/01e7621516f3a4b76def5aeb90986955 to your computer and use it in GitHub Desktop.
Save joaquimnetocel/01e7621516f3a4b76def5aeb90986955 to your computer and use it in GitHub Desktop.
R SPEED TEST
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