自1980年以来的钟表功能? [英] function for clockticks since 1980?

查看:64
本文介绍了自1980年以来的钟表功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我曾经使用其他语言的功能(TP或asm不记得了)

我可以获得的数量自1980年以来的时钟。在C中有类似的

函数吗?我似乎没有找到它。

我需要播种随机生成器,因为它是一个网络服务器应用程序,我

不能播种与日期/时间因为分辨率不是很好

够了。如果应用程序在同一秒内运行两次(或毫秒或

,无论分辨率是多少),那么随机生成器将以相同的值播种

!不好。也不想使用clockticks

处理器到目前为止用于运行该程序。在我看来,这是自1980年以来我们需要的
函数,或者是另一个保证的增值价值。


谢谢。

Tobias

解决方案

7月28日下午7:52,nsa .... @ gmail.com写道:





我曾经使用其他语言的功能(TP或asm don'不记得了。

自1980年以来我可以得到多个时钟信号。在C中有类似的

函数吗?我似乎没有找到它。

我需要播种随机生成器,因为它是一个网络服务器应用程序,我

不能播种与日期/时间因为分辨率不是很好

够了。如果应用程序在同一秒内运行两次(或毫秒或

,无论分辨率是多少),那么随机生成器将以相同的值播种

!不好。也不想使用clockticks

处理器到目前为止用于运行该程序。在我看来,这是自1980年以来我们需要的
函数,或者是另一个保证的增值价值。


谢谢。

Tobias



为什么不使用IP地址?


< blockquote> 7月29日凌晨1点59分,swengineer ... @ gmail.com

< swengineer ... @ gmail.comwrote:


7月28日下午7:52,nsa .... @ gmail.com写道:




我曾经使用过其他语言的函数(TP或asm不记得了)

我可以获得自发布以来的数量1980.C中有类似的

函数吗?我似乎没有找到它。

我需要播种随机生成器,因为它是一个网络服务器应用程序,我

不能播种与日期/时间因为分辨率不是很好

够了。如果应用程序在同一秒内运行两次(或毫秒或

,无论分辨率是多少),那么随机生成器将以相同的值播种

!不好。也不想使用clockticks

处理器到目前为止用于运行该程序。在我看来,这是自1980年以来我们需要的价格,或者另一个保证增值的b $ b函数。


谢谢。

Tobias



为什么不使用IP地址?



用户? ip可以被NAT并且它也很容易猜测,因此会有安全风险。我需要随机种子生成

唯一会话ID ....所以每次程序运行它*必须*使用

不同的随机种子..


干杯,

Tobias



ns ***** @ gmail.com 写道:


7月29日,1:59 am,swengineer ... @ gmail.com

< swengineer ... @ gmail.comwrote:


> 7月28日下午7:52,nsa .... @ gmail.com写道:




我曾经使用其他语言的函数(TP或asm不记得了)

我可以获得自1980年以来的时钟数量。是否有类似的

在C中的功能?我似乎没有找到它。

我需要播种随机生成器,因为它是一个网络服务器应用程序,我

不能播种与日期/时间因为分辨率不是很好

够了。如果应用程序在同一秒内运行两次(或毫秒或

,无论分辨率是多少),那么随机生成器将以相同的值播种

!不好。也不想使用clockticks

处理器到目前为止用于运行该程序。在我看来,这是自1980年以来我们需要的价格,或者另一个保证增值的b $ b函数。


谢谢。

Tobias


为什么不使用IP地址?



的用户? ip可以被NAT并且它也很容易猜测,因此会有安全风险。我需要随机种子生成

唯一会话ID ....所以每次程序运行它*必须*使用

不同的随机种子..



您可以使用CryptGenRandom和CryptGenRandom。在WIN32系统中,和/ dev / random在

Linux。


最好的问候

徐伟江

-

一切都有规则!


Hi,

I used to use a function in other languages (TP or asm don''t remember)
where I could get number of clockticks since 1980. Is there a similar
function in C? I don''t seem to find it.
I need to seed the random generator and since it''s a web-server app, I
can''t seed with the date/time because the resolution is not great
enough. If the app runs twice in the same second (or millisecond or
whatever the resolution is) then the random generator will be seeded
with the same value! not good. Also don''t want to use clockticks
processor has used so far to run the program. It seems to me this
function of ticks since 1980 is what I need, or another guranteed
incremental value.

Thanks.
Tobias

解决方案

On Jul 28, 7:52 pm, nsa....@gmail.com wrote:

Hi,

I used to use a function in other languages (TP or asm don''t remember)
where I could get number of clockticks since 1980. Is there a similar
function in C? I don''t seem to find it.
I need to seed the random generator and since it''s a web-server app, I
can''t seed with the date/time because the resolution is not great
enough. If the app runs twice in the same second (or millisecond or
whatever the resolution is) then the random generator will be seeded
with the same value! not good. Also don''t want to use clockticks
processor has used so far to run the program. It seems to me this
function of ticks since 1980 is what I need, or another guranteed
incremental value.

Thanks.
Tobias

Why not use the IP address?


On Jul 29, 1:59 am, "swengineer...@gmail.com"
<swengineer...@gmail.comwrote:

On Jul 28, 7:52 pm, nsa....@gmail.com wrote:

Hi,

I used to use a function in other languages (TP or asm don''t remember)
where I could get number of clockticks since 1980. Is there a similar
function in C? I don''t seem to find it.
I need to seed the random generator and since it''s a web-server app, I
can''t seed with the date/time because the resolution is not great
enough. If the app runs twice in the same second (or millisecond or
whatever the resolution is) then the random generator will be seeded
with the same value! not good. Also don''t want to use clockticks
processor has used so far to run the program. It seems to me this
function of ticks since 1980 is what I need, or another guranteed
incremental value.

Thanks.
Tobias


Why not use the IP address?

of the user? the ip can be NATed and also it would be too easy to
guess so would be security risk. I need the random seed to generate
unique session ids.... so everytime the program runs it *must* use a
different random seed..

Cheers,
Tobias



ns*****@gmail.com writes:

On Jul 29, 1:59 am, "swengineer...@gmail.com"
<swengineer...@gmail.comwrote:

>On Jul 28, 7:52 pm, nsa....@gmail.com wrote:

Hi,

I used to use a function in other languages (TP or asm don''t remember)
where I could get number of clockticks since 1980. Is there a similar
function in C? I don''t seem to find it.
I need to seed the random generator and since it''s a web-server app, I
can''t seed with the date/time because the resolution is not great
enough. If the app runs twice in the same second (or millisecond or
whatever the resolution is) then the random generator will be seeded
with the same value! not good. Also don''t want to use clockticks
processor has used so far to run the program. It seems to me this
function of ticks since 1980 is what I need, or another guranteed
incremental value.

Thanks.
Tobias


Why not use the IP address?


of the user? the ip can be NATed and also it would be too easy to
guess so would be security risk. I need the random seed to generate
unique session ids.... so everytime the program runs it *must* use a
different random seed..

You can use "CryptGenRandom" in WIN32 systems, and "/dev/random" in
Linux.

Best regards
Xu Weijiang
--
everything has its rules!


这篇关于自1980年以来的钟表功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆