Sponsored Content
Top Forums Programming C time in milliseconds function. Post 37740 by S.P.Prasad on Friday 27th of June 2003 04:54:24 AM
Old 06-27-2003
Try with usleep ( ) Standard C Library routine
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

useing date or other time style utility to get milliseconds.

hello everyone. im sure someone has run into the problem of timestamping files and end up haveing 2 files with the same name thus over writeing one of them. In my application i am trying to get a timestamp w/ milliseconds but i am haveing no luck and finding an answer in the man pages. I know... (3 Replies)
Discussion started by: Optimus_P
3 Replies

2. Shell Programming and Scripting

time function

Hi, I would like to display the exact time taken to complete running a particular tool or function or program to user I don't know the exact time functions in unix, please help me thanks in advance Example: $test.ksh output should be The... (10 Replies)
Discussion started by: hsekol
10 Replies

3. Programming

function time

Hello I have problem with function 'time' to test my program for file copying . How to run the function in my source code ? I try something like that: system("time"); < -- but this don't working (2 Replies)
Discussion started by: scotty_123
2 Replies

4. Shell Programming and Scripting

Convert milliseconds to standard time

hello, I have the uptime of the server showing as upTime=2427742050 How do I convert it to standard time. Thanks Chiru (1 Reply)
Discussion started by: chiru_h
1 Replies

5. Shell Programming and Scripting

Nawk Time Function

Hi All, I am using solaris and nawk. Is there any time function in nawk which is simliar to the shell `date` function ? Can any experts show any examples? (4 Replies)
Discussion started by: Raynon
4 Replies

6. UNIX for Dummies Questions & Answers

time function

hello everybody! i want to post a question. So, I use the command 'time a.out' to time the duration of the program a.out. The return value of this function was: real 0m4.116s user 0m4.112s sys 0m0.016s What i want is! I try to find a way to get (NOT manually) the value of real time.... (2 Replies)
Discussion started by: nicos
2 Replies

7. Shell Programming and Scripting

Getting Time in MilliSeconds with Perl

I use something like this in perl to get the date and time: use Time::localtime; use Time::gmtime; $tm = gmtime; $time_str = sprintf "%04d-%02d-%02d %02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; It gives me something like this: 2010-08-26... (1 Reply)
Discussion started by: lforum
1 Replies

8. Solaris

Process execution time in milliseconds

Hey everyone, I'm coming from Linux where the top command gave me lots of process info (particularly CPU time in milliseconds) and I'm trying to find similar info in Solaris. So far I've looked at prstat and ps but neither give cpu time in milliseconds, both seem to have 1 second... (2 Replies)
Discussion started by: maniac_ie
2 Replies

9. UNIX for Beginners Questions & Answers

Milliseconds Not Capture

while I load the value using sqlldr the millisecond values not stored in oracle table. Value: '26-OCT-17 08.59.50.916000000 AM' CTL field: SRC_SYS_CRT_TS Position(23:48) "decode(:SRC_SYS_CRT_TS,null,sysdate-1,to_timestamp(:SRC_SYS_CRT_TS,'yyyy-mm-dd.hh24.mi.ss.FF'))", ... (1 Reply)
Discussion started by: priya1987
1 Replies

10. Shell Programming and Scripting

Calculate Time diff in milli milliseconds(Time format : HH:MM:SS,NNN)

Hi All, I have one file which contains time for request and response. I want to calculate time difference in milliseconds for each line. This file can contain 10K lines. Sample file with 4 lines. for first line. Request Time: 15:23:45,255 Response Time: 15:23:45,258 Time diff... (6 Replies)
Discussion started by: Raza Ali
6 Replies
AnyEvent::XMPP::Util(3pm)				User Contributed Perl Documentation				 AnyEvent::XMPP::Util(3pm)

NAME
AnyEvent::XMPP::Util - Utility functions for AnyEvent::XMPP SYNOPSIS
use AnyEvent::XMPP::Util qw/split_jid/; ... FUNCTIONS
These functions can be exported if you want: resourceprep ($string) This function applies the stringprep profile for resources to $string and returns the result. nodeprep ($string) This function applies the stringprep profile for nodes to $string and returns the result. prep_join_jid ($node, $domain, $resource) This function joins the parts $node, $domain and $resource to a full jid and applies stringprep profiles. If the profiles couldn't be applied undef will be returned. join_jid ($user, $domain, $resource) This is a plain concatenation of $user, $domain and $resource without stringprep. See also prep_join_jid split_uri ($uri) This function splits up the $uri into service and node part and will return them as list. my ($service, $node) = split_uri ($uri); split_jid ($jid) This function splits up the $jid into user/node, domain and resource part and will return them as list. my ($user, $host, $res) = split_jid ($jid); node_jid ($jid) See "prep_res_jid" below. domain_jid ($jid) See "prep_res_jid" below. res_jid ($jid) See "prep_res_jid" below. prep_node_jid ($jid) See "prep_res_jid" below. prep_domain_jid ($jid) See "prep_res_jid" below. prep_res_jid ($jid) These functions return the corresponding parts of a JID. The "prep_" prefixed JIDs return the stringprep'ed versions. stringprep_jid ($jid) This applies stringprep to all parts of the jid according to the RFC 3920. Use this if you want to compare two jids like this: stringprep_jid ($jid_a) eq stringprep_jid ($jid_b) This function returns undef if the $jid couldn't successfully be parsed and the preparations done. cmp_jid ($jid1, $jid2) This function compares two jids $jid1 and $jid2 whether they are equal. cmp_bare_jid ($jid1, $jid2) This function compares two jids $jid1 and $jid2 whether their bare part is equal. prep_bare_jid ($jid) This function makes the jid $jid a bare jid, meaning: it will strip off the resource part. With stringprep. bare_jid ($jid) This function makes the jid $jid a bare jid, meaning: it will strip off the resource part. But without stringprep. is_bare_jid ($jid) This method returns a boolean which indicates whether $jid is a bare JID. filter_xml_chars ($string) This function removes all characters from $string which are not allowed in XML and returns the new string. filter_xml_attr_hash_chars ($hashref) This runs all values of the $hashref through "filter_xml_chars" (see above) and changes them in-place! simxml ($w, %xmlstruct) This function takes a XML::Writer as first argument ($w) and the rest key value pairs: simxml ($w, defns => '<xmlnamespace>', node => <node>, prefixes => { prefix => namespace, ... }, ); Where node is: <node> := { ns => '<xmlnamespace>', name => 'tagname', attrs => [ 'name', 'value', 'name2', 'value2', ... ], childs => [ <node>, ... ] } | { dns => '<xmlnamespace>', # this will set that namespace to # the default namespace before using it. name => 'tagname', attrs => [ 'name', 'value', 'name2', 'value2', ... ], childs => [ <node>, ... ] } | sub { my ($w) = @_; ... } # with $w being a XML::Writer object | "textnode" Please note: "childs" stands for "child sequence" :-) Also note that if you omit the "ns" key for nodes there is a fall back to the namespace of the parent element or the last default namespace. This makes it easier to write things like this: { defns => 'muc_owner', node => { name => 'query' } } (Without having to include "ns" in the node.) Please note that all attribute values and character data will be filtered by "filter_xml_chars". This is a bigger example: ... $msg->append_creation( sub { my($w) = @_; simxml($w, defns => 'muc_user', # sets the default namepsace for all following elements node => { name => 'x', # element 'x' in namespace 'muc_user' childs => [ { 'name' => 'invite', # element 'invite' in namespace 'muc_user' 'attrs' => [ 'to', $to_jid ], # to="$to_jid" attribute for 'invite' 'childs' => [ { # the <reason>$reason</reason> element in the invite element 'name' => 'reason', childs => [ $reason ] } ], } ] } ); }); to_xmpp_time ($sec, $min, $hour, $tz, $secfrac) This function transforms a time to the XMPP date time format. The meanings and value ranges of $sec, ..., $hour are explained in the perldoc of Perl's builtin "localtime". $tz has to be either "UTC" or of the form "[+-]hh:mm", it can be undefined and wont occur in the time string then. $secfrac are optional and can be the fractions of the second. See also XEP-0082. to_xmpp_datetime ($sec,$min,$hour,$mday,$mon,$year,$tz, $secfrac) This function transforms a time to the XMPP date time format. The meanings of $sec, ..., $year are explained in the perldoc of Perl's "localtime" builtin and have the same value ranges. $tz has to be either "Z" (for UTC) or of the form "[+-]hh:mm" (offset from UTC), if it is undefined "Z" will be used. $secfrac are optional and can be the fractions of the second. See also XEP-0082. from_xmpp_datetime ($string) This function transforms the $string which is either a time or datetime in XMPP format. If the string was not in the right format an empty list is returned. Otherwise this is returned: my ($sec, $min, $hour, $mday, $mon, $year, $tz, $secfrac) = from_xmpp_datetime ($string); For the value ranges and semantics of $sec, ..., $srcfrac please look at the documentation for "to_xmpp_datetime". $tz and $secfrac might be undefined. If $tz is undefined the timezone is to be assumed to be UTC. If $string contained just a time $mday, $mon and $year will be undefined. See also XEP-0082. xmpp_datetime_as_timestamp ($string) This function takes the same arguments as "from_xmpp_datetime", but returns a unix timestamp, like "time ()" would. This function requires the POSIX module. AUTHOR
Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>" COPYRIGHT &; LICENSE Copyright 2007, 2008 Robin Redeker, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-01-23 AnyEvent::XMPP::Util(3pm)
All times are GMT -4. The time now is 06:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy