Keil Logo

C51 Version 7 Operation Timings
Compact Model

The following benchmarks provide a baseline for the execution speed of code generated by the Keil C51 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: 12MHz)
 
XTAL Frequency: MHz
Instruction Clock Divisor:
 

Unsigned Character Operations

Operation Min Avg Max
unsigned char + 11
1.83 µSecs
11
1.83 µSecs
11
1.83 µSecs
unsigned char - 12
2.00 µSecs
12
2.00 µSecs
12
2.00 µSecs
unsigned char * 16
2.67 µSecs
16
2.67 µSecs
16
2.67 µSecs
unsigned char / 16
2.67 µSecs
16
2.67 µSecs
16
2.67 µSecs
unsigned char % 17
2.83 µSecs
17
2.83 µSecs
17
2.83 µSecs
unsigned char >> 18
3.00 µSecs
48
8.00 µSecs
78
13.00 µSecs
unsigned char << 18
3.00 µSecs
48
8.00 µSecs
78
13.00 µSecs

Signed Character Operations

Operation Min Avg Max
signed char + 11
1.83 µSecs
11
1.83 µSecs
11
1.83 µSecs
signed char - 12
2.00 µSecs
12
2.00 µSecs
12
2.00 µSecs
signed char * 16
2.67 µSecs
16
2.67 µSecs
16
2.67 µSecs
signed char / 28
4.67 µSecs
35
5.83 µSecs
40
6.67 µSecs
signed char % 31
5.17 µSecs
38
6.33 µSecs
43
7.17 µSecs
signed char >> 18
3.00 µSecs
48
8.00 µSecs
78
13.00 µSecs
signed char << 18
3.00 µSecs
48
8.00 µSecs
78
13.00 µSecs
cabs () 20
3.33 µSecs
21
3.50 µSecs
22
3.67 µSecs

Unsigned Integer Operations

Operation Min Avg Max
unsigned int + 22
3.67 µSecs
22
3.67 µSecs
22
3.67 µSecs
unsigned int - 23
3.83 µSecs
23
3.83 µSecs
23
3.83 µSecs
unsigned int * 54
9.00 µSecs
54
9.00 µSecs
54
9.00 µSecs
unsigned int / 174
29.00 µSecs
177
29.50 µSecs
204
34.00 µSecs
unsigned int % 174
29.00 µSecs
177
29.50 µSecs
204
34.00 µSecs
unsigned int >> 28
4.67 µSecs
80
13.33 µSecs
133
22.17 µSecs
unsigned int << 28
4.67 µSecs
80
13.33 µSecs
133
22.17 µSecs

Signed Integer Operations

Operation Min Avg Max
signed int + 22
3.67 µSecs
22
3.67 µSecs
22
3.67 µSecs
signed int - 23
3.83 µSecs
23
3.83 µSecs
23
3.83 µSecs
signed int * 54
9.00 µSecs
54
9.00 µSecs
54
9.00 µSecs
signed int / 55
9.17 µSecs
206
34.33 µSecs
241
40.17 µSecs
signed int % 55
9.17 µSecs
206
34.33 µSecs
241
40.17 µSecs
signed int >> 28
4.67 µSecs
80
13.33 µSecs
133
22.17 µSecs
signed int << 28
4.67 µSecs
80
13.33 µSecs
133
22.17 µSecs
abs () 28
4.67 µSecs
30
5.00 µSecs
33
5.50 µSecs

Unsigned Long Operations

Operation Min Avg Max
unsigned long + 65
10.83 µSecs
65
10.83 µSecs
65
10.83 µSecs
unsigned long - 68
11.33 µSecs
68
11.33 µSecs
68
11.33 µSecs
unsigned long * 161
26.83 µSecs
161
26.83 µSecs
161
26.83 µSecs
unsigned long / 286
47.67 µSecs
293
48.83 µSecs
352
58.67 µSecs
unsigned long % 294
49.00 µSecs
301
50.17 µSecs
360
60.00 µSecs
unsigned long >> 52
8.67 µSecs
284
47.33 µSecs
517
86.17 µSecs
unsigned long << 52
8.67 µSecs
284
47.33 µSecs
517
86.17 µSecs

Signed Long Operations

Operation Min Avg Max
signed long + 65
10.83 µSecs
65
10.83 µSecs
65
10.83 µSecs
signed long - 68
11.33 µSecs
68
11.33 µSecs
68
11.33 µSecs
signed long * 161
26.83 µSecs
161
26.83 µSecs
161
26.83 µSecs
signed long / 299
49.83 µSecs
339
56.50 µSecs
651
108.50 µSecs
signed long % 307
51.17 µSecs
347
57.83 µSecs
659
109.83 µSecs
signed long >> 52
8.67 µSecs
284
47.33 µSecs
517
86.17 µSecs
signed long << 52
8.67 µSecs
284
47.33 µSecs
517
86.17 µSecs
labs () 86
14.33 µSecs
93
15.50 µSecs
101
16.83 µSecs

Floating-Point Operations

Operation Min Avg Max
float + 181
30.17 µSecs
228
38.00 µSecs
394
65.67 µSecs
float - 169
28.17 µSecs
234
39.00 µSecs
367
61.17 µSecs
float * 148
24.67 µSecs
248
41.33 µSecs
260
43.33 µSecs
float / 692
115.33 µSecs
928
154.67 µSecs
1,107
184.50 µSecs
fmod () 380
63.33 µSecs
2,179
363.17 µSecs
4,063
677.17 µSecs
modf () 1,642
273.67 µSecs
2,134
355.67 µSecs
2,302
383.67 µSecs
fabs () 48
8.00 µSecs
49
8.17 µSecs
51
8.50 µSecs
ceil () 1,244
207.33 µSecs
1,703
283.83 µSecs
1,930
321.67 µSecs
floor () 1,244
207.33 µSecs
1,702
283.67 µSecs
1,945
324.17 µSecs
pow () 865
144.17 µSecs
3,828
638.00 µSecs
10,506
1,751.00 µSecs
sqrt () 55
9.17 µSecs
1,159
193.17 µSecs
2,416
402.67 µSecs
exp () 266
44.33 µSecs
298
49.67 µSecs
4,499
749.83 µSecs
log () 60
10.00 µSecs
2,063
343.83 µSecs
4,317
719.50 µSecs
log10 () 62
10.33 µSecs
2,164
360.67 µSecs
4,517
752.83 µSecs
sin () 677
112.83 µSecs
3,308
551.33 µSecs
3,760
626.67 µSecs
cos () 619
103.17 µSecs
3,310
551.67 µSecs
3,740
623.33 µSecs
tan () 4,319
719.83 µSecs
4,686
781.00 µSecs
4,866
811.00 µSecs
asin () 366
61.00 µSecs
7,295
1,215.83 µSecs
8,699
1,449.83 µSecs
acos () 859
143.17 µSecs
7,867
1,311.17 µSecs
8,868
1,478.00 µSecs
atan () 1,593
265.50 µSecs
4,387
731.17 µSecs
5,357
892.83 µSecs
atan2 () 1,938
323.00 µSecs
5,175
862.50 µSecs
6,661
1,110.17 µSecs
sinh () 2,858
476.33 µSecs
10,829
1,804.83 µSecs
11,809
1,968.17 µSecs
cosh () 2,904
484.00 µSecs
10,814
1,802.33 µSecs
11,792
1,965.33 µSecs
tanh () 10,367
1,727.83 µSecs
11,022
1,837.00 µSecs
12,896
2,149.33 µSecs

Buffer Operations

Operation Min Avg Max
memset (10) 87
14.50 µSecs
87
14.50 µSecs
87
14.50 µSecs
memset (100) 627
104.50 µSecs
627
104.50 µSecs
627
104.50 µSecs
memset (1000) 6,033
1,005.50 µSecs
6,033
1,005.50 µSecs
6,033
1,005.50 µSecs
memcpy (10) 280
46.67 µSecs
280
46.67 µSecs
280
46.67 µSecs
memcpy (100) 2,260
376.67 µSecs
2,260
376.67 µSecs
2,260
376.67 µSecs
memcpy (1000) 22,066
3,677.67 µSecs
22,066
3,677.67 µSecs
22,066
3,677.67 µSecs
memmove
(10 with overlap)
289
48.17 µSecs
289
48.17 µSecs
289
48.17 µSecs
memmove
(100 with overlap)
2,269
378.17 µSecs
2,269
378.17 µSecs
2,269
378.17 µSecs
memmove
(1000 with overlap)
22,075
3,679.17 µSecs
22,075
3,679.17 µSecs
22,075
3,679.17 µSecs

Memory Allocation Operations

Operation Min Avg Max
malloc (),
99.3% successful
160
26.67 µSecs
694
115.67 µSecs
1,571
261.83 µSecs
free () 225
37.50 µSecs
833
138.83 µSecs
1,665
277.50 µSecs

Notes Note

  • These tests were performed and measured using the µVision Debugger. Test code was compiled with the C51 Version 7.20 C Compiler using the Compact Memory Model, ROM(Large), and Optimization Level 8-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.