From 795f9f65a171bbdb289c88544082ecf804bb4234 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 29 Mar 2006 20:38:31 +0000 Subject: [PATCH] added basic opensrf.system.time method git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@673 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/OpenSRF/Application.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/perlmods/OpenSRF/Application.pm b/src/perlmods/OpenSRF/Application.pm index 4723850..99803e8 100644 --- a/src/perlmods/OpenSRF/Application.pm +++ b/src/perlmods/OpenSRF/Application.pm @@ -707,6 +707,22 @@ __PACKAGE__->register_method( }, ); +sub time_method { + my( $self, $conn ) = @_; + my $t = time; + $t =~ s/\..*//og; # - remove milli/microseconds from Time::HiRes (should we strip this?) + return $t; +} +__PACKAGE__->register_method( + method => 'time_method', + argc => 0, + api_name => 'opensrf.system.time', + signature => { + desc => q/Returns the current system time as epoch seconds/, + return => { desc => q/epoch seconds/ } + } +); + sub make_stream_atomic { my $self = shift; my $req = shift; -- 2.11.0