Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "npc.h"
- #include<ctime>
- #include<iostream>
- using namespace std;
- int main() {
- char* memory = new char[10 * 1024 * 1024];
- int endOfStack = 0;
- cout << sizeof(NPC) << endl;
- clock_t begin = clock();
- const int numNPCs = 10000;
- NPC** NPCs = new NPC*[sizeof(NPC) * numNPCs];
- // NPC* NPCs[numNPCs];
- for(int i=0; i < numNPCs; ++i) {
- // NPCs[i] = new NPC();
- new (NPCs[i]) NPC();
- }
- /**/
- for(int i=0; i < numNPCs; ++i) {
- NPCs[i]->update(); // :-/
- }
- clock_t end = clock();
- double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
- cout << "elapsed time: " << elapsed_secs << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment