当前位置:网站首页>Common usage of time library
Common usage of time library
2022-07-04 06:29:00 【Suyuoa】
time Kuo is python Library with built-in processing time , Now let me talk about its common usage
1 Pause for a few seconds time.sleep()

Show first 1, And then after 1 Show in seconds 2
import time
print(1)
time.sleep(1)
print(2)![]()
2 return 1970 Floating point seconds to now time.time()

import time
a = time.time()
print(a)
print(type(a))![]()
3 Enter a tuple and return a time character time.asctime()

import time
a = time.asctime((2021,8,31,14,31,50,0,0,0))
print(a)
print(type(a))![]()
If no parameter is given, the current time will be returned
import time
a = time.asctime()
print(a)
print(type(a))![]()
4 Entering a floating-point second will return a time character time.ctime()

import time
a = time.ctime(1630391743.9544106)
print(a)
print(type(a))![]()
If no parameter is given, the current time will be returned
import time
a = time.ctime()
print(a)
print(type(a))![]()
5 Entering a floating-point second will return a gmt Time time.gmtime()

import time
a = time.gmtime(1630391743.9544106)
print(a)
print(type(a))
If no parameter is given, the current value will be returned gmt Time
import time
a = time.gmtime()
print(a)
print(type(a))
6 Entering a floating-point second will return a local time time.localtime

import time
a = time.localtime(1630391743.9544106)
print(a)
print(type(a))
If no parameter is given, the current local time will be returned
import time
a = time.localtime()
print(a)
print(type(a))
边栏推荐
- AWT介绍
- 如何避免 JVM 内存泄漏?
- Sort list tool class, which can sort strings
- what the fuck! If you can't grab it, write it yourself. Use code to realize a Bing Dwen Dwen. It's so beautiful ~!
- 注释与注解
- Error CVC complex type 2.4. a: Invalid content beginning with element 'base extension' was found. Should start with one of '{layoutlib}'.
- The sorting in C language realizes the number sorting method from small to large
- AWT introduction
- Invalid revision: 3.18.1-g262b901-dirty
- STM32 单片机ADC 电压计算
猜你喜欢

C réaliser des jeux de serpents gourmands

报错cvc-complex-type.2.4.a: 发现了以元素 ‘base-extension‘ 开头的无效内容。应以 ‘{layoutlib}‘ 之一开头。

High performance parallel programming and optimization | lesson 02 homework at home

Tree DP

APScheduler如何设置任务不并发(即第一个任务执行完再执行下一个)?

Detectron:训练自己的数据集——将自己的数据格式转换成COCO格式

云原生——上云必读之SSH篇(常用于远程登录云服务器)

The solution of win11 taskbar right click without Task Manager - add win11 taskbar right click function

AWT常用组件、FileDialog文件选择框

My NVIDIA developer journey - optimizing graphics card performance
随机推荐
[March 3, 2019] MAC starts redis
How does apscheduler set tasks not to be concurrent (that is, execute the next task after the first one)?
How to implement lazy loading in El select (with search function)
Considerations for testing a website
Abap:ooalv realizes the function of adding, deleting, modifying and checking
2022.7.2-----leetcode. eight hundred and seventy-one
体验碎周报第 102 期(2022.7.4)
How to determine whether an array contains an element
Appium基础 — APPium安装(二)
双色球案例
Tf/pytorch/cafe-cv/nlp/ audio - practical demonstration of full ecosystem CPU deployment - Intel openvino tool suite course summary (Part 2)
Realize IIC data / instruction interaction with micro batg135
How to get the parent node of all nodes in El tree
Arcpy uses the updatelayer function to change the symbol system of the layer
QT releases multilingual International Translation
Notes and notes
4G wireless all network solar hydrological equipment power monitoring system bms110
Arcpy 利用updatelayer函数改变图层的符号系统
C language exercises (recursion)
Experience weekly report no. 102 (July 4, 2022)