Keil Logo

C251 Version 3 Operation Timings
X-Tiny Model

The following benchmarks provide a baseline for the execution speed of code generated by the Keil C251 Compiler. Automated test scripts were used to calculate the minimum, average, and maximum time required for each operation.

Each benchmark lists the number of states and the number of seconds required to perform the operation. The state time represents the actual number of instruction cycles. You may specify the oscillator frequency and the clock divisor (for the instruction clock) to obtain execution times in seconds.

Enter MCU Speed Details
(Default XTAL Frequency: 16MHz)
 
XTAL Frequency: MHz
Instruction Clock Divisor:
 

Unsigned Character Operations

Operation Min Avg Max
unsigned char + 7
.88 µSecs
7
.88 µSecs
7
.88 µSecs
unsigned char - 7
.88 µSecs
7
.88 µSecs
7
.88 µSecs
unsigned char * 12
1.50 µSecs
12
1.50 µSecs
12
1.50 µSecs
unsigned char / 17
2.13 µSecs
17
2.13 µSecs
17
2.13 µSecs
unsigned char % 17
2.13 µSecs
17
2.13 µSecs
17
2.13 µSecs
unsigned char >> 12
1.50 µSecs
57
7.13 µSecs
110
13.75 µSecs
unsigned char << 12
1.50 µSecs
51
6.38 µSecs
96
12.00 µSecs

Signed Character Operations

Operation Min Avg Max
signed char + 7
.88 µSecs
7
.88 µSecs
7
.88 µSecs
signed char - 7
.88 µSecs
7
.88 µSecs
7
.88 µSecs
signed char * 12
1.50 µSecs
12
1.50 µSecs
12
1.50 µSecs
signed char / 50
6.25 µSecs
54
6.75 µSecs
60
7.50 µSecs
signed char % 50
6.25 µSecs
54
6.75 µSecs
60
7.50 µSecs
signed char >> 12
1.50 µSecs
51
6.38 µSecs
96
12.00 µSecs
signed char << 12
1.50 µSecs
51
6.38 µSecs
96
12.00 µSecs
cabs () 26
3.25 µSecs
30
3.75 µSecs
34
4.25 µSecs

Unsigned Integer Operations

Operation Min Avg Max
unsigned int + 10
1.25 µSecs
10
1.25 µSecs
10
1.25 µSecs
unsigned int - 10
1.25 µSecs
10
1.25 µSecs
10
1.25 µSecs
unsigned int * 21
2.63 µSecs
21
2.63 µSecs
21
2.63 µSecs
unsigned int / 31
3.88 µSecs
31
3.88 µSecs
31
3.88 µSecs
unsigned int % 31
3.88 µSecs
31
3.88 µSecs
31
3.88 µSecs
unsigned int >> 15
1.88 µSecs
60
7.50 µSecs
113
14.13 µSecs
unsigned int << 15
1.88 µSecs
54
6.75 µSecs
99
12.38 µSecs

Signed Integer Operations

Operation Min Avg Max
signed int + 10
1.25 µSecs
10
1.25 µSecs
10
1.25 µSecs
signed int - 10
1.25 µSecs
10
1.25 µSecs
10
1.25 µSecs
signed int * 21
2.63 µSecs
21
2.63 µSecs
21
2.63 µSecs
signed int / 66
8.25 µSecs
73
9.13 µSecs
80
10.00 µSecs
signed int % 66
8.25 µSecs
73
9.13 µSecs
80
10.00 µSecs
signed int >> 15
1.88 µSecs
54
6.75 µSecs
99
12.38 µSecs
signed int << 15
1.88 µSecs
60
7.50 µSecs
113
14.13 µSecs
abs () 28
3.50 µSecs
31
3.88 µSecs
35
4.38 µSecs

Unsigned Long Operations

Operation Min Avg Max
unsigned long + 20
2.50 µSecs
20
2.50 µSecs
20
2.50 µSecs
unsigned long - 20
2.50 µSecs
20
2.50 µSecs
20
2.50 µSecs
unsigned long * 72
9.00 µSecs
72
9.00 µSecs
72
9.00 µSecs
unsigned long / 435
54.38 µSecs
446
55.75 µSecs
461
57.63 µSecs
unsigned long % 435
54.38 µSecs
446
55.75 µSecs
461
57.63 µSecs
unsigned long >> 21
2.63 µSecs
189
23.63 µSecs
387
48.38 µSecs
unsigned long << 22
2.75 µSecs
154
19.25 µSecs
294
36.75 µSecs

Signed Long Operations

Operation Min Avg Max
signed long + 20
2.50 µSecs
20
2.50 µSecs
20
2.50 µSecs
signed long - 20
2.50 µSecs
20
2.50 µSecs
20
2.50 µSecs
signed long * 72
9.00 µSecs
72
9.00 µSecs
72
9.00 µSecs
signed long / 470
58.75 µSecs
500
62.50 µSecs
533
66.63 µSecs
signed long % 470
58.75 µSecs
500
62.50 µSecs
533
66.63 µSecs
signed long >> 21
2.63 µSecs
185
23.13 µSecs
379
47.38 µSecs
signed long << 22
2.75 µSecs
154
19.25 µSecs
294
36.75 µSecs
labs () 37
4.63 µSecs
42
5.25 µSecs
47
5.88 µSecs

Floating-Point Operations

Operation Min Avg Max
float + 166
20.75 µSecs
250
31.25 µSecs
354
44.25 µSecs
float - 136
17.00 µSecs
253
31.63 µSecs
372
46.50 µSecs
float * 143
17.88 µSecs
194
24.25 µSecs
207
25.88 µSecs
float / 683
85.38 µSecs
716
89.50 µSecs
742
92.75 µSecs
modf () 705
88.13 µSecs
1,206
150.75 µSecs
1,295
161.88 µSecs
fabs () 35
4.38 µSecs
35
4.38 µSecs
36
4.50 µSecs
ceil () 964
120.50 µSecs
1,366
170.75 µSecs
1,699
212.38 µSecs
floor () 964
120.50 µSecs
1,366
170.75 µSecs
1,699
212.38 µSecs
pow () 666
83.25 µSecs
3,403
425.38 µSecs
9,543
1,192.88 µSecs
sqrt () 49
6.13 µSecs
951
118.88 µSecs
1,968
246.00 µSecs
exp () 230
28.75 µSecs
271
33.88 µSecs
4,941
617.63 µSecs
log () 53
6.63 µSecs
1,850
231.25 µSecs
3,857
482.13 µSecs
log10 () 235
29.38 µSecs
2,035
254.38 µSecs
4,040
505.00 µSecs
sin () 555
69.38 µSecs
2,943
367.88 µSecs
3,374
421.75 µSecs
cos () 522
65.25 µSecs
2,940
367.50 µSecs
3,349
418.63 µSecs
tan () 3,943
492.88 µSecs
4,050
506.25 µSecs
4,241
530.13 µSecs
asin () 412
51.50 µSecs
6,499
812.38 µSecs
7,671
958.88 µSecs
acos () 812
101.50 µSecs
7,041
880.13 µSecs
7,902
987.75 µSecs
atan () 1,626
203.25 µSecs
3,948
493.50 µSecs
4,631
578.88 µSecs
atan2 () 1,803
225.38 µSecs
4,627
578.38 µSecs
5,792
724.00 µSecs
sinh () 2,390
298.75 µSecs
10,129
1,266.13 µSecs
10,765
1,345.63 µSecs
cosh () 2,456
307.00 µSecs
10,124
1,265.50 µSecs
10,733
1,341.63 µSecs
tanh () 9,279
1,159.88 µSecs
10,228
1,278.50 µSecs
11,577
1,447.13 µSecs

Buffer Operations

Operation Min Avg Max
memset (10) 139
17.38 µSecs
139
17.38 µSecs
139
17.38 µSecs
memset (100) 1,129
141.13 µSecs
1,129
141.13 µSecs
1,129
141.13 µSecs
memset (1000) 11,029
1,378.63 µSecs
11,029
1,378.63 µSecs
11,029
1,378.63 µSecs
memcpy (10) 192
24.00 µSecs
192
24.00 µSecs
192
24.00 µSecs
memcpy (100) 1,632
204.00 µSecs
1,632
204.00 µSecs
1,632
204.00 µSecs
memcpy (1000) 16,032
2,004.00 µSecs
16,032
2,004.00 µSecs
16,032
2,004.00 µSecs
memmove
(10 with overlap)
207
25.88 µSecs
207
25.88 µSecs
207
25.88 µSecs
memmove
(100 with overlap)
1,647
205.88 µSecs
1,647
205.88 µSecs
1,647
205.88 µSecs
memmove
(1000 with overlap)
16,047
2,005.88 µSecs
16,047
2,005.88 µSecs
16,047
2,005.88 µSecs

Memory Allocation Operations

Operation Min Avg Max
malloc (),
99.7% successful
56
7.00 µSecs
250
31.25 µSecs
642
80.25 µSecs
free () 72
9.00 µSecs
219
27.38 µSecs
455
56.88 µSecs

Notes Note

  • These tests were performed and measured using the µVision Debugger. Test code was compiled with the C251 Version 3.60 C Compiler using the X-Tiny Memory Model, 251-source mode, ROM(LARGE), and Optimization Level 7-SPEED.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.