diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-07-27 15:49:02 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-07-27 15:49:02 +0000 |
commit | 07ba70f731218eb74993553ff4923fd2ece3635b (patch) | |
tree | 4f4c1ec11eac116ef90927f6dcc686a7c3253fc5 /src/util/time.c | |
parent | 95daec0a418692408dadb9d0071b717295dde047 (diff) | |
download | gnunet-07ba70f731218eb74993553ff4923fd2ece3635b.tar.gz gnunet-07ba70f731218eb74993553ff4923fd2ece3635b.zip |
use arm timeouts, bad GNUNET_TIME function that will probably get removed
Diffstat (limited to 'src/util/time.c')
-rw-r--r-- | src/util/time.c | 19 |
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 | */ | ||
498 | const char * | ||
499 | GNUNET_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 */ |