X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fhelper%2Ftime_support.c;h=8337e73ba7518f20a90437032c9eb3acbeacdab1;hp=f7e9352238077b17db03bdd6c127c0767c93c359;hb=d0e763ac7ef6aa17b17bd00ccdfbccfb4eacda69;hpb=8b00e56e6433cff3ff818835953b27765aaabab0 diff --git a/src/helper/time_support.c b/src/helper/time_support.c index f7e9352238..8337e73ba7 100644 --- a/src/helper/time_support.c +++ b/src/helper/time_support.c @@ -19,9 +19,7 @@ * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * along with this program. If not, see . * ***************************************************************************/ #ifdef HAVE_CONFIG_H @@ -78,14 +76,14 @@ int duration_measure(struct duration *duration) return retval; } -float duration_elapsed(struct duration *duration) +float duration_elapsed(const struct duration *duration) { float t = duration->elapsed.tv_sec; t += (float)duration->elapsed.tv_usec / 1000000.0; return t; } -float duration_kbps(struct duration *duration, size_t count) +float duration_kbps(const struct duration *duration, size_t count) { return count / (1024.0 * duration_elapsed(duration)); }