aboutsummaryrefslogtreecommitdiff
path: root/src/util/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/time.c')
-rw-r--r--src/util/time.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/util/time.c b/src/util/time.c
index 5ae05b0d7..3631c0a78 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -486,6 +486,25 @@ GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a)
486 486
487} 487}
488 488
489/**
490 * Convert a relative time to a string.
491 * This is one of the very few calls in the entire API that is
492 * NOT reentrant!
493 *
494 * @param time the time to print
495 *
496 * @return string form of the time (as milliseconds)
497 */
498const char *
499GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time)
500{
501 static char time_string[21];
502 memset(time_string, 0, sizeof(time_string));
503
504 sprintf(time_string, "%lu", time.rel_value);
505 return (const char *) time_string;
506}
507
489 508
490 509
491/* end of time.c */ 510/* end of time.c */