-
-
Save IshanArya/55743f73a0892f19373986ff1dff951c to your computer and use it in GitHub Desktop.
A CPU intensive operation. Use to test imitate blocking code, test WebWorkers etc.
This file contains hidden or 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
| import "math" | |
| func intenseFunc(n int) int { | |
| var result float64 = 0 | |
| v := float64(n) | |
| for i := math.Pow(v, 7); i >= 0; i-- { | |
| u := float64(i) | |
| result += math.Atan(u) * math.Tan(u) | |
| } | |
| return int(result) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment