X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fhelper%2Ftime_support.c;h=780eb96949e75804d26edd820235450830524faf;hb=baf08b0a1ad656434583e3c102a350d4cf885bf9;hp=f7e9352238077b17db03bdd6c127c0767c93c359;hpb=8b00e56e6433cff3ff818835953b27765aaabab0;p=openocd.git diff --git a/src/helper/time_support.c b/src/helper/time_support.c index f7e9352238..780eb96949 100644 --- a/src/helper/time_support.c +++ b/src/helper/time_support.c @@ -21,7 +21,7 @@ * 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. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H @@ -78,14 +78,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)); }