It is currently Sat Jun 15, 2019 9:48 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Function Pointers
PostPosted: Mon Nov 24, 2008 6:39 am 
Offline

Joined: Thu Sep 15, 2005 9:23 am
Posts: 1236
Location: Berlin, Germany
Would these be faster than a bigger lookup table? (I'm talking about 65816 emulation here, changing the pointers of functions when switching between Native and Emulation mode)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2008 10:43 am 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
You haven't provided enough information. Probably better to learn how to measure performance and compare the two on your machine. This is a good start:
Code:
#include <stdio.h>
#include <time.h>
int main()
{
    clock_t start = clock();
    unsigned n;
    for ( n = 1000000; --n; )
        /* do something here */
    printf( "time taken: %f\n", (double) (clock() - start) );
    return 0;
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group