git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2774
4a8a32a2-be11-0410-ad9d-
d568d2c75423
#include <string.h>
#include "aslink.h"
#include <string.h>
#include "aslink.h"
+#ifdef WIN32T
+#include <time.h>
+
+void Timer(int action, char * message)
+{
+ static double start, end, total=0.0;
+ static const double secs_per_tick = 1.0 / CLOCKS_PER_SEC;
+
+ if(action==0) start=clock()*secs_per_tick;
+ else if(action==1)
+ {
+ end=clock() * secs_per_tick;
+ printf("%s \t%f seconds.\n", message, (end-start));
+ total+=end-start;
+ }
+ else
+ {
+ printf("Total time: \t%f seconds.\n", total);
+ total=0.0;
+ }
+}
+#endif
+
/* yuck - but including unistd.h causes problems on Cygwin by redefining
* Addr_T.
*/
/* yuck - but including unistd.h causes problems on Cygwin by redefining
* Addr_T.
*/
register char *p;
register int c, i;
register char *p;
register int c, i;
+#ifdef WIN32T
+ Timer(0, "");
+#endif
+
startp = (struct lfile *) new (sizeof (struct lfile));
pflag = 1;
startp = (struct lfile *) new (sizeof (struct lfile));
pflag = 1;
+#ifdef WIN32T
+ Timer(1, "Linker execution time");
+#endif
+
lkexit(lkerr);
return 0;
}
lkexit(lkerr);
return 0;
}
#define TARGET_STRING "gbz80"
#endif
#define TARGET_STRING "gbz80"
#endif
+#ifdef WIN32T
+#include <time.h>
+
+void Timer(int action, char * message)
+{
+ static double start, end, total=0.0;
+ static const double secs_per_tick = 1.0 / CLOCKS_PER_SEC;
+
+ if(action==0) start=clock()*secs_per_tick;
+ else if(action==1)
+ {
+ end=clock() * secs_per_tick;
+ printf("%s \t%f seconds.\n", message, (end-start));
+ total+=end-start;
+ }
+ else
+ {
+ printf("Total time: \t%f seconds.\n", total);
+ total=0.0;
+ }
+}
+#endif
+
/*)Module lkmain.c
*
* The module lkmain.c contains the functions which
/*)Module lkmain.c
*
* The module lkmain.c contains the functions which
register char *p;
register int c, i;
register char *p;
register int c, i;
+#ifdef WIN32T
+ Timer(0, "");
+#endif
+
#ifdef GAMEBOY
nb_rom_banks = 2;
nb_ram_banks = 0;
#ifdef GAMEBOY
nb_rom_banks = 2;
nb_ram_banks = 0;
+#ifdef WIN32T
+ Timer(1, "Linker time");
+#endif
lkexit(lkerr);
/* Never get here. */
lkexit(lkerr);
/* Never get here. */