Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: How to get system time

How to get system time 20 Apr 2010 08:46 #7650

Hi,

Anyone knows like how to read current system time in milliseconds using ttcn3?

I want to use unique random number each time in my script. But rnd function won't guarantee the uniqueness. It may and it has generated same values. So I think to guarantee unique random number each time is to use system time.

If anyone knows how to get system time in milliseconds or has a better idea to generate a unique random number please let me know.

Thanks in advance,


Best Regards,
Vishwanath S Bhat

________________________________
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."
The administrator has disabled public write access.

How to get system time 20 Apr 2010 09:18 #7651

Hi Vishwanath,

if you are using rnd() without seed and it generates a same sequence of float values each time you execute the test case, you should write a trouble report to your tool provider. The standard says in C.35:
", if no new seed is provided, the last generated number will be used as seed for the next random number. Without a previous initialization a value calculated from the system time will be used as seed value when rnd is used the first time."

System date/time can be obtained in TTCN-3 by an external function, currently no such feature is provided by the language.

BR, Gyorgy

________________________________
From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Vishwanath Subraya Bhat
Sent: 2010-április-20 10:46
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: How to get system time

Hi,

Anyone knows like how to read current system time in milliseconds using ttcn3?

I want to use unique random number each time in my script. But rnd function won't guarantee the uniqueness. It may and it has generated same values. So I think to guarantee unique random number each time is to use system time.

If anyone knows how to get system time in milliseconds or has a better idea to generate a unique random number please let me know.

Thanks in advance,


Best Regards,
Vishwanath S Bhat

________________________________
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."
The administrator has disabled public write access.

How to get system time 20 Apr 2010 10:02 #7652

Dear Vishwanath S Bath,

two things I would like to mention here: In my understand random does not equal to uniqueness. Just because something is random this does not meant that it will not occur a second time. I think lot of scientific paper has been produced to show what a good random number generator is and what not. However uniqueness was never a criteria ;-)

Now, if you would like the feature for a unique number just use your favorite implementation and integrate it via the external function mechanism provide in TTCN-3.

So let's assume you have a library in C that does the job, just declare in your ttcn-3 script.

external function uniqueNumber() return integer;

And then implement in the PA the triExternalFunction() operation.

So you get exactly the functionality that you require.

Best regards, Theo

Theofanis Vassiliou-Gioles

Testing Technologies IST GmbH
Michaelkirchstraße 17/18
10179 Berlin, Germany

Phone +49 30 726 19 190 Email This email address is being protected from spambots. You need JavaScript enabled to view it.
Fax +49 30 726 19 19 20 Internet www.testingtech.com
UPCOMING EVENTS

April 26, Schloß-Steinhöfel-Seminar
"Innovationen in Markt und Forschung"
www.asqf.de/fachgruppentermine-anzeige/e...nhoefel-seminar.html

May 25-27, TETRA World Congress
Singapore
www.tetraworldcongress.com

June 8-10, TTCN-3 User Conference
China, Beijing
www.ttcn3-asiaforum.com/T3UC2010/en/index.asp
Geschäftsführung: Theofanis Vassiliou-Gioles, Stephan Pietsch
Handelsregister HRB 77805,
Amtsgericht Charlottenburg Ust ID Nr.: DE 813 143 070

This e-mail may contain confidential and privileged material for
the sole use of the intended recipient. Any review, use,
distribution or disclosure by others is strictly prohibited. If you
are not the intended recipient (or authorized to receive for the
recipient), please contact the sender by reply e-mail and delete
all copies of this message.


Am 20.04.2010 um 10:46 schrieb Vishwanath Subraya Bhat:

> Hi,
>
> Anyone knows like how to read current system time in milliseconds using ttcn3?
>
> I want to use unique random number each time in my script. But rnd function won’t guarantee the uniqueness. It may and it has generated same values. So I think to guarantee unique random number each time is to use system time.
>
> If anyone knows how to get system time in milliseconds or has a better idea to generate a unique random number please let me know.
>
> Thanks in advance,
>
>
> Best Regards,
> Vishwanath S Bhat
>
> "DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."
The administrator has disabled public write access.

How to get system time 20 Apr 2010 10:15 #7653

Hi Theo,

Thanks for the reply. I will try what you suggested. But when I was trying to write external C++ code for other functionality I was facing lot of problems with it. So I would have preferred this functionality in ttcn3 itself.
But since this functionality is not available in ttcn3 I will look into that again.
Also to write an external function do we have write the header file too or it will get automatically generated?

Thank You,

Br.
Vishwanath S Bhat

________________________________
From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Theofanis Vassiliou-Gioles
Sent: Tuesday, April 20, 2010 3:32 PM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: How to get system time

Dear Vishwanath S Bath,

two things I would like to mention here: In my understand random does not equal to uniqueness. Just because something is random this does not meant that it will not occur a second time. I think lot of scientific paper has been produced to show what a good random number generator is and what not. However uniqueness was never a criteria ;-)

Now, if you would like the feature for a unique number just use your favorite implementation and integrate it via the external function mechanism provide in TTCN-3.

So let's assume you have a library in C that does the job, just declare in your ttcn-3 script.

external function uniqueNumber() return integer;

And then implement in the PA the triExternalFunction() operation.

So you get exactly the functionality that you require.

Best regards, Theo

Theofanis Vassiliou-Gioles

Testing Technologies IST GmbH
Michaelkirchstraße 17/18
10179 Berlin, Germany

Phone +49 30 726 19 190 Email This email address is being protected from spambots. You need JavaScript enabled to view it.<This email address is being protected from spambots. You need JavaScript enabled to view it.>
Fax +49 30 726 19 19 20 Internet www.testingtech.com<www.testingtech.com>
UPCOMING EVENTS

April 26, Schloß-Steinhöfel-Seminar
"Innovationen in Markt und Forschung"
www.asqf.de/fachgruppentermine-anzeige/e...nhoefel-seminar.html<www.asqf.de/fachgruppentermine-anzeige/e...nhoefel-seminar.html>

May 25-27, TETRA World Congress
Singapore
www.tetraworldcongress.com<www.tetraworldcongress.com>

June 8-10, TTCN-3 User Conference
China, Beijing
www.ttcn3-asiaforum.com/T3UC2010/en/index.asp<www.ttcn3-asiaforum.com/T3UC2010/en/index.asp>
Geschäftsführung: Theofanis Vassiliou-Gioles, Stephan Pietsch
Handelsregister HRB 77805,
Amtsgericht Charlottenburg Ust ID Nr.: DE 813 143 070

This e-mail may contain confidential and privileged material for
the sole use of the intended recipient. Any review, use,
distribution or disclosure by others is strictly prohibited. If you
are not the intended recipient (or authorized to receive for the
recipient), please contact the sender by reply e-mail and delete
all copies of this message.


Am 20.04.2010 um 10:46 schrieb Vishwanath Subraya Bhat:


Hi,

Anyone knows like how to read current system time in milliseconds using ttcn3?

I want to use unique random number each time in my script. But rnd function won't guarantee the uniqueness. It may and it has generated same values. So I think to guarantee unique random number each time is to use system time.

If anyone knows how to get system time in milliseconds or has a better idea to generate a unique random number please let me know.

Thanks in advance,


Best Regards,
Vishwanath S Bhat

________________________________
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."


________________________________
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin