STM32F4(用SysTick实现精确测量程序运行的时间)
GitHub仓库:https://github.com/XinLiGitHub/STM32F4xx_MeasureTime_Example
PS:博文不再更新,后续更新会在GitHub仓库进行。
在实际的项目开发过程中,常常遇到需要得到一段代码的运行时间,通常的方法是用示波器来测量,这篇博文将用SysTick来实现精确测量程序运行的时间。STM32F4的内核定时器SysTick是一个24位的定时器,需要注意最大的测量时间。
1,开发环境
1,固件库:STM32F4xx_DSP_StdPeriph_Lib_V1.8.0
2,编译器:ARMCC V5.06
3,IDE:Keil uVision5
4,操作系统:Windows 10 专业版
2,程序源码
MeasureTime.h文件
/**
******************************************************************************
* @file MeasureTime.h
* @author XinLi
* @version v1.0
* @date 24-October-2017
* @brief Measure program run time module.
******************************************************************************
* @attention
*
* <h2><center>Copyright © 2017 XinLi</center></h2>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General P