Changeset 2102
- Timestamp:
- Jul 4, 2008 11:43:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/test/mips_test.c
r2101 r2102 1 /* $Id :$ */1 /* $Id$ */ 2 2 /* 3 3 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> … … 22 22 /* Define your CPU MIPS here!! */ 23 23 24 #ifndef CPU_ MIPS24 #ifndef CPU_IPS 25 25 /* 26 26 For complete table see: … … 52 52 */ 53 53 54 # define CPU_MHZ (2666.666) 55 # define CPU_MIPS (CPU_MHZ * MEGA * 3.039) /* P4 2.6GHz */ 56 57 //# define CPU_MHZ 700 58 //# define CPU_MIPS (700 * MEGA * 2.708) /* P3 700Mhz */ 54 //# define CPU_MHZ (2666) 55 //# define CPU_IPS (CPU_MHZ * MEGA * 3.039) /* P4 2.6GHz */ 56 57 # define CPU_MHZ 700 58 # define CPU_IPS (700 * MEGA * 2.708) /* P3 700Mhz */ 59 60 //# define CPU_MHZ 180 61 //# define CPU_IPS (CPU_MHZ * MEGA * 1.1) /* ARM926EJ-S */ 59 62 #endif 60 63 … … 1765 1768 pool = pj_pool_create(mem, "pool", 1024, 1024, NULL); 1766 1769 port = e->init(pool, clock_rate, 1, samples_per_frame, 0, e); 1767 pj_assert(port != NULL); 1770 if (port == NULL) { 1771 t0.u64 = 0; 1772 pj_pool_release(pool); 1773 PJ_LOG(1,(THIS_FILE, " init error")); 1774 return t0; 1775 } 1776 1768 1777 gen_port = create_gen_port(pool, clock_rate, 1, 1769 1778 samples_per_frame, 100); 1770 pj_assert(gen_port != NULL); 1779 if (gen_port == NULL) { 1780 t0.u64 = 0; 1781 pj_pool_release(pool); 1782 return t0; 1783 } 1771 1784 1772 1785 pj_get_timestamp(&t0); … … 1889 1902 unsigned i, c, k[2] = {K8, K16}, clock_rates[2] = {8000, 16000}; 1890 1903 1891 PJ_LOG(3,(THIS_FILE, "MIPS test, with CPU=% 7.2fMhz, %f MIPS", CPU_MHZ, CPU_MIPS / 1000000));1904 PJ_LOG(3,(THIS_FILE, "MIPS test, with CPU=%dMhz, %6.1f MIPS", CPU_MHZ, CPU_IPS / 1000000)); 1892 1905 PJ_LOG(3,(THIS_FILE, "Clock Item Time CPU MIPS")); 1893 1906 PJ_LOG(3,(THIS_FILE, " Rate (usec) (%%) ")); … … 1932 1945 pj_elapsed_usec(&tzero, ×[1])) / 2; 1933 1946 1934 mips = (float)(CPU_ MIPS * usec / 1000000.0 / 1000000);1947 mips = (float)(CPU_IPS * usec / 1000000.0 / 1000000); 1935 1948 cpu_pct = (float)(100.0 * usec / 1000000); 1936 PJ_LOG(3,(THIS_FILE, "%2dKHz %-38s % 8d %6.3f %7.2f",1949 PJ_LOG(3,(THIS_FILE, "%2dKHz %-38s % 8d %8.3f %7.2f", 1937 1950 clock_rate/1000, e->title, usec, cpu_pct, mips)); 1938 1951
Note: See TracChangeset
for help on using the changeset viewer.