File: profile_test.bf

package info (click to toggle)
hyphy 2.5.69%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,728 kB
  • sloc: cpp: 81,964; xml: 467; lisp: 341; python: 166; javascript: 117; sh: 106; makefile: 87; ansic: 86
file content (36 lines) | stat: -rw-r--r-- 860 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#profile START;

s = 0;
m = {5,1};

for (k=0; k<250000; k=k+1)
{
	s = s + k;
	t = Random (0,5);
	m [t] = m [t] + 1;
}

#profile PAUSE;

s2 = 0;
for (k=1; k<10000; k=k+1)
{
	s2 = s2+1/k;
}

#profile _hyphy_profile_dump;

stats  			= _hyphy_profile_dump["STATS"];
_profile_summer	= {1,Rows(stats)};
_profile_summer = _profile_summer["1"] * stats;
_instructions   = _hyphy_profile_dump["INSTRUCTION"];
_indices	    = _hyphy_profile_dump["INSTRUCTION INDEX"];

fprintf (stdout, "\nTotal run time (seconds)      : ", Format(_profile_summer[1]/1000000,15,6),
				 "\nTotal number of steps         : ", Format(_profile_summer[0],15,0), "\n\n");
				 
for (k=0; k<Columns(_instructions); k=k+1)
{
	fprintf (stdout, Format (_indices[k],6,0), " : ", _instructions[k], "\n\tCall count: ", stats[k][0], 
												   "\n\tTime (seconds): ", stats[k][1]/1000000, "\n");
}