Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function addTest(): void
- {
- var vec0:Vector3D = new Vector3D(0, 0, 0);
- var vec1:Vector3D = new Vector3D(Math.random(), Math.random(), Math.random());
- Profiler.startTimer("Manual");
- for (var i:int = 0; i < 10000000; i++)
- {
- vec0.x += vec1.x;
- vec0.y += vec1.y;
- }
- Profiler.stopTimer("Manual");
- Profiler.startTimer("Auto");
- for (var i:int = 0; i < 10000000; i++)
- {
- vec0.add(vec1);
- }
- Profiler.stopTimer("Auto");
- // OUTPUT:
- // Manual : 1171
- // Auto : 5659
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement