Created
          October 13, 2017 01:03 
        
      - 
      
- 
        Save anvarazizov/2fab5aa77e687f2c35a27ce09d430d8e to your computer and use it in GitHub Desktop. 
    print time in swift with milliseconds
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | func printDate(string: String) { | |
| let date = Date() | |
| let formatter = DateFormatter() | |
| formatter.dateFormat = "HH:mm:ss.SSSS" | |
| print(string + formatter.string(from: date)) | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
There are many convenient options now:
Check out What's new in Foundation from #wwdc21