代码如下:
definitions:
Result:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
FindUID:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
data:
type: object
properties:
uid:
type: integer
format: int64
FindUsername:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
data:
type: object
properties:
username:
type: string
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,第一部分FindUID和FindUsername是一样的Result.如何用这些重复的代码替换Result?
pid(A, B, C)可以生成一个pid <A.B.C>,我如何从pid中获取A,B和C?
get_base_exp(PlayerLv)->
case PlayerLv of
1->30;
2->30;
3->60;
4->100;
5->160;
6->240;
7->330;
8->440;
9->570;
10->710;
11->880;
12->1060
end.
Run Code Online (Sandbox Code Playgroud)
以下内容:
get_base_exp(PlayerLv)->
case PlayerLv of
1 -> 30;
2 -> 30;
3 -> 60;
4 -> 100;
5 -> 160;
6 -> 240;
7 -> 330;
8 -> 440;
9 -> 570;
10 -> 710;
11 -> 880;
12 -> 1060
end.
Run Code Online (Sandbox Code Playgroud) 返回元组{MegaSecs,Secs,MicroSecs},它是自格林威治标准时间1970年1月1日00:00(零小时)起经过的时间,假设底层操作系统支持此操作.否则,选择其他一些时间点.还保证随后对此BIF的调用会不断返回增加的值.因此,now()的返回值可用于生成唯一的时间戳,如果在快速机器上的紧密循环中调用它,则节点的时间可能会变得偏斜.
粗体句意味着什么?我有点困惑,因为我的英语不是很好:)是否意味着时间线以45度上升或者是否意味着如果erlang:now/0经常调用节点的性能会降低?
非常感谢你.