Difference between "convert" printf () and retailmsg ()

Source: Internet
Author: User

From: http://blog.chinaunix.net/u2/74100/showart_1154283.html

 

Difference between printf () and retailmsg ()

This printf () may be familiar to everyone, and retailmsg () is used in the embedded development of S3C2410, ARM9. it is used in the EVC operating system. When debugging information, you usually use these functions to display output information. EVC also supports both functions. However, if the system requires high real-time performance, the two functions will be very different. The time used by the printf function is much larger than that of retailmsg. The call of the printf function takes about 100 milliseconds, while the retailmsg () takes about 10 milliseconds. Therefore, in debugging of the debug version, where the output information is located, use retailmsg () to use retailmsg (); Do not use printf as much as possible; of course, in real‑version, all the functions that output debugging information should be shielded as much as possible; the method is to use # ifdef, as follows: # ifdef debug
Printf ("\ n broadcast hello ");
# Endif; [or] # ifdef debug
Retailmsg (1, (text ("receive a packet \ t \ n"); # endif; then, in the debug version, why the printf function and retailmsg () what is the difference in time ?? This question is to be studied ???????

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.